コード例 #1
0
 public void Delete(Size size)
 {
     using (DbManager db = new DbManager())
     {
         Accessor.Query.Delete(db, size);
     }
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 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();
 }
コード例 #4
0
 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);
         }
     }
 }
コード例 #5
0
 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;
 }
コード例 #6
0
 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;
 }
コード例 #7
0
 protected void btnYes_Click(object sender, EventArgs e)
 {
     size = SM.GetSizeByKey(long.Parse(gvSizesList.SelectedRow.Cells[2].Text));
     SM.Delete(size);
     LoadSizes();
 }