public Dictionary <string, ChildItem> GetChildList() { var list = new Dictionary <string, ChildItem>(); var items = ModelChildren.I().GetItems("1 order by `fio` ASC"); if (items != null) { while (items.Read()) { list.Add( items["id"].ToString(), new ChildItem() { Id = items["id"].ToString(), Fio = items["fio"].ToString(), DataOtkritiyaKarty = items["data_otkritiya_karty"].ToString(), RazmerOdegdy = items["razmer_odegdy"].ToString(), RazmerObuvy = items["razmer_obuvy"].ToString(), RazmerGolavy = items["razmer_golavy"].ToString() } ); } } return(list); }
public static ModelChildren I() { if (Instanse == null) { Instanse = new ModelChildren(); } return(Instanse); }
public void Search() { dataGridViewDetiSearch.Rows.Clear(); var items = ModelChildren.I().Search(textBoxSearch.Text); int i = 0; foreach (var it in items)//а здесь собственно записи полей { i++; int rowNumber = dataGridViewDetiSearch.Rows.Add(); dataGridViewDetiSearch.Rows[rowNumber].Cells["id"].Value = it.Id; dataGridViewDetiSearch.Rows[rowNumber].Cells["data_otkritiya_karty"].Value = it.DataOtkritiyaKarty; dataGridViewDetiSearch.Rows[rowNumber].Cells["fio"].Value = it.Fio; dataGridViewDetiSearch.Rows[rowNumber].Cells["razmer_odegdy"].Value = it.RazmerOdegdy; dataGridViewDetiSearch.Rows[rowNumber].Cells["razmer_obuvy"].Value = it.RazmerObuvy; dataGridViewDetiSearch.Rows[rowNumber].Cells["razmer_golavy"].Value = it.RazmerGolavy; } }
public OrderItem GetItemForOtchet(string id) { { var data = GetById(id); if (data != null) { data.Read(); var item = new OrderItem() { Id = data["id"].ToString(), IdChild = data["id_child"].ToString(), Date = data["date"].ToString() }; item.Child = ModelChildren.I().GetItem(item.IdChild); item.Fio = item.Child.Fio; item.Items = ModelOrderItems.I().GetClothesList(id).Values.ToList(); return(item); } return(null); } }
protected void LoadChildList(String idChild) { comboBoxChild.Items.Clear(); childList.Clear(); childList = ModelChildren.I().GetChildList(); if (childList.Count > 0) { int i = 0; foreach (var it in childList) { comboBoxChild.Items.Add(it.Value.Fio); if (idChild == it.Value.Id) { comboBoxChild.SelectedIndex = i; } i++; } if (comboBoxChild.SelectedIndex < 0) { comboBoxChild.SelectedIndex = 0; } } }
private void buttonDelete_Click(object sender, EventArgs e) { Int32 selectedRowCount = dataGridViewDetiSearch.SelectedRows.Count; if (selectedRowCount > 0) { var resault = MessageBox.Show( "Вы уверенны что хотите удалить выбранные строки?", "Подтверждение удаления", MessageBoxButtons.YesNo ); if (resault == DialogResult.Yes) { String delet_id_str = GetIdSetFromSelectedRows(); ModelChildren.I().DeleteByIdSet(delet_id_str); Search(); } } else { MessageBox.Show("Выберите хотя бы одну строку"); } }
public ChildEditForm(FormSpisokDetey form) { InitializeComponent(); formSpisokDetey = form; modelChildren = ModelChildren.I(); }
public ChildEditForm() { InitializeComponent(); modelChildren = new ModelChildren(); }
public FormSpisokDetey() { InitializeComponent(); modelChildren = new ModelChildren(); }