This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// GET: /Book/Create | |
public ActionResult Create() | |
{ | |
ViewData["authors"] = _entities.Authors.ToList<Author>(); | |
return View(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="editor-label"> | |
<%= Html.LabelFor(model => model.Authors) %> | |
</div> | |
<span id="authorChackboxes"> | |
<% List<Author> authors = ViewData["authors"] as List<Author>; | |
foreach (Author author in authors) | |
{ | |
string checkboxId = string.Format("author{0}", author.Id); %> | |
<input type="checkbox" | |
id="<%= Html.Encode(checkboxId) %>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// POST: /Book/Create | |
[HttpPost] | |
public ActionResult Create([Bind(Exclude = "Id")] Book bookToCreate, int[] authorIds) | |
{ | |
if (!ModelState.IsValid) | |
{ | |
return View(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<EntityType Name="BookAuthors"> | |
<Key> | |
<PropertyRef Name="BookId" /> | |
<PropertyRef Name="AuthorId" /> | |
</Key> | |
<!-- Закомментированные стоки - как было, незакомментированные - как стало. --> | |
<!--<Property Name="BookId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" /> | |
<Property Name="AuthorId" Type="int" Nullable="false" StoreGeneratedPattern="Identity" />--> | |
<Property Name="BookId" Type="int" Nullable="false" /> | |
<Property Name="AuthorId" Type="int" Nullable="false" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--5. Кто из клиентов с годовым доходом более 10 миллионов долларов отправлял грузы весом менее 100 фунта или отправлял грузы в Балтимор? | |
select distinct k.naimenovanie | |
from dbo.klient k, dbo.perevozka p | |
where k.kod_klienta = p.kod_klienta and | |
k.godovoi_dohod > 10000000 and | |
(p.ves < 100 or p.punkt_naznachenija = 'Балтимор') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~/project-name$ hg init | |
~/project-name$ hg addremove | |
~/project-name$ hg commit -m "Initial commit." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ cd ~/Dropbox | |
~/Dropbox$ hg clone ~/project-name ~/Dropbox/Hg/project-name --noupdate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[paths] | |
default = /home/username/Dropbox/Hg/project-name/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ hg push | |
$ hg pull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Dev\Projects> hg clone "C:\Users\username\My Dropbox\project-name" project-name |
OlderNewer