Exemplo n.º 1
0
 /// <summary>
 /// Edit Function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         SizeSP   spSize   = new SizeSP();
         SizeInfo infoSize = new SizeInfo();
         infoSize.Size      = txtSize.Text.Trim();
         infoSize.Narration = txtNarration.Text.Trim();
         infoSize.Extra1    = String.Empty;
         infoSize.Extra2    = String.Empty;
         infoSize.SizeId    = decSizeId;
         if (spSize.SizeNameCheckExistence(txtSize.Text.Trim().ToString(), decSizeId) == false)
         {
             if (spSize.SizeEditing(infoSize))
             {
                 Messages.UpdatedMessage();
                 GridFill();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Size already exist");
             txtSize.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SZ3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// Save Function
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         SizeSP   spSize   = new SizeSP();
         SizeInfo infoSize = new SizeInfo();
         infoSize.Size      = txtSize.Text.Trim();
         infoSize.Narration = txtNarration.Text.Trim();
         infoSize.Extra1    = String.Empty;
         infoSize.Extra2    = String.Empty;
         if (spSize.SizeNameCheckExistence(txtSize.Text.Trim().ToString(), 0) == false)
         {
             decIdentity = spSize.SizeAdding(infoSize);
             if (decIdentity > 0)
             {
                 Messages.SavedMessage();
                 GridFill();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage(" Size already exist");
             txtSize.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("SZ2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Function to check existence of size based on parameter
 /// </summary>
 /// <param name="strSizeName"></param>
 /// <param name="decSizeId"></param>
 /// <returns></returns>
 public bool SizeNameCheckExistence(String strSizeName, decimal decSizeId)
 {
     try
     {
         spSize.SizeNameCheckExistence(strSizeName, decSizeId);
     }
     catch (Exception ex)
     {
         MessageBox.Show("SZ2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     return(false);
 }