示例#1
0
        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);
        }
示例#2
0
 public static ModelChildren I()
 {
     if (Instanse == null)
     {
         Instanse = new ModelChildren();
     }
     return(Instanse);
 }
示例#3
0
        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;
            }
        }
示例#4
0
 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);
     }
 }
示例#5
0
 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;
         }
     }
 }
示例#6
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("Выберите хотя бы одну строку");
            }
        }
示例#7
0
 public ChildEditForm(FormSpisokDetey form)
 {
     InitializeComponent();
     formSpisokDetey = form;
     modelChildren   = ModelChildren.I();
 }
示例#8
0
 public ChildEditForm()
 {
     InitializeComponent();
       modelChildren = new ModelChildren();
 }
示例#9
0
 public FormSpisokDetey()
 {
     InitializeComponent();
     modelChildren = new ModelChildren();
 }