public void Delete(Size size) { using (DbManager db = new DbManager()) { Accessor.Query.Delete(db, size); } }
protected void btnSaveUpdate_Click(object sender, EventArgs e) { size = SM.GetSizeByKey(long.Parse(gvSizesList.SelectedRow.Cells[2].Text)); size.SizeCode = txtSizeCodeUpdate.Text.ToUpper(); size.SizeDescription = txtSizeDescriptionUpdate.Text.ToUpper(); SM.Save(size); LoadSizes(); }
protected void btnSaveSize_Click(object sender, EventArgs e) { size = new Size{ SizeCode = txtSizeCode.Text.ToUpper(), SizeDescription = txtSizeDescription.Text.ToUpper(), DateCreated = DateTimeOffset.Now }; SM.Save(size); txtSizeCode.Text = null; txtSizeDescription.Text = null; LoadSizes(); }
public void Save(Size size) { using (DbManager db = new DbManager()) { if (size.RecordNo != 0) { Accessor.Query.Update(db, size); } else { Accessor.Query.Insert(db, size); } } }
private bool CheckIfSizeAlreadyExist(Size size) { bool result; var sizes_list = (from size_ in StyleSizeManager.StyleSizes() where size_.SizeCode == size.SizeCode select size_).ToList<StyleSize>(); StyleSize s_size = new StyleSize(); foreach (StyleSize size_s in sizes_list) { s_size = size_s; } if (s_size.RecordNo > 0) { result = true; } else { result = false; } return result; }
protected void gvSizesList_SelectedIndexChanged(object sender, EventArgs e) { size = SM.GetSizeByKey(long.Parse(gvSizesList.SelectedRow.Cells[2].Text)); txtSizeCodeUpdate.Text = size.SizeCode; txtSizeDescriptionUpdate.Text = size.SizeDescription; }
protected void btnYes_Click(object sender, EventArgs e) { size = SM.GetSizeByKey(long.Parse(gvSizesList.SelectedRow.Cells[2].Text)); SM.Delete(size); LoadSizes(); }