public void Delete(int idDiller) { Diler diller = getItem(idDiller); list.Remove(diller); diller.Delete(); }
internal void Add(Diler diller) { if (list.Exists(item => item == diller)) { return; } list.Add(diller); }
protected override void loadFromSql() { DataTable dt = _provider.Select("Diller"); foreach (DataRow row in dt.Rows) { Diler diller = new Diler(row); Add(diller); } }
private void ShowAddEdit(Diler diller) { Dictionary_AddEdit view = new Dictionary_AddEdit("Карточка \"Дилера\""); DictionaryPresenter presenter = new DictionaryPresenter(view, diller); if (view.ShowDialog() == System.Windows.Forms.DialogResult.OK) { loadData(); } }
private void changeDiler(int idDiler) { DilerList dilerList = DilerList.getInstance(); Diler diller = dilerList.getItem(idDiler); if (diller != null) { tbDealerContacts.Text = diller.Text; } }
private void _dgvDiller_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { int idDiller; int.TryParse(_dgv.Rows[_dgv.SelectedCells[0].RowIndex].Cells[0].Value.ToString(), out idDiller); DilerList dillerList = DilerList.getInstance(); Diler diller = dillerList.getItem(idDiller); ShowAddEdit(diller); }
public async Task <PartialViewResult> GetAttachsInfoEdit(string code) { using (DataContext _db = new DataContext()) { var id = 0; List <int> attach_diler = new List <int>(); List <Diler> attach_diler_ID = new List <Diler>(); var custumer_id = _db.Customers.Where(c => c.Code == code).Select(s => s.Id).FirstOrDefault(); List <CustomerSellAttachments> attach = new List <CustomerSellAttachments>(); // _db.CustomerSellAttachments.Where(a => a.CustomerID == custumer_id && a.Diler_Id == data.diller_id).ToList(); attach = _db.CustomerSellAttachments.Where(a => a.CustomerID == custumer_id).Include("Customer").Include("Attachment").ToList(); var customerSellA = from custAttachs in attach let dt = custAttachs.Tdate let diler_id = custAttachs.Diler_Id group custAttachs by new { y = dt.Year, m = dt.Month, d = dt.Day, diler = diler_id } into cGroup select cGroup; foreach (var group in customerSellA) { Diler diler_group = new Diler(); diler_group.diler = group.Select(s => s.Diler_Id).FirstOrDefault(); diler_group.tdate = group.Select(s => s.Tdate.ToString("dd-MM-yyy")).FirstOrDefault(); attach_diler_ID.Add(diler_group); var itemgrop = group.Select(s => s.Diler_Id).FirstOrDefault(); } //foreach (var item in attach) //{ // Diler _diler_item = new Diler(); // _diler_item.diler = item.Diler_Id; // _diler_item.tdate = item.Tdate.ToString("dd-MM-yyy"); // if (attach_diler.Contains(item.Diler_Id)) // { // } // else // { // //attach_diler_ID.Add(_diler_item); // attach_diler.Add(item.Diler_Id); // } //} //Diler _diler_items = new Diler(); List <User> user_info = _db.Users.Include("UserType") /*.Where(c => c.UserType.Name.Contains("დილერი") || c.UserType.Id == 1 || c.UserType.Id == 2 || c.UserType.Id == 4 || c.UserType.Id == 5)*/.ToList(); ViewBag.Bort = user_info; ViewBag.attachmenlist = _db.SellAttachments.ToList(); ViewBag.attachdilerID = attach_diler_ID.OrderBy(d => d.tdate).ToList();; ViewBag.Code = code; return(PartialView("~/Views/CustomerAttach/_AttachInfoEdit.cshtml", attach)); } }
public IActionResult Edit(Diler model) { _context.Dilers.Update(model); _context.SaveChanges(); return(RedirectToAction("Index")); }