Exemplo n.º 1
0
 /// <summary>
 /// update function
 /// </summary>
 public void EditFunction()
 {
     try
     {
         UnitSP   spUnit   = new UnitSP();
         UnitInfo infoUnit = new UnitInfo();
         infoUnit.UnitName          = txtUnitname.Text.Trim();
         infoUnit.noOfDecimalplaces = Convert.ToDecimal(txtDecimalPlaces.Text.ToString());
         infoUnit.Narration         = txtNarration.Text.Trim();
         infoUnit.formalName        = txtFormalName.Text.Trim();
         infoUnit.UnitId            = decUnitid;
         infoUnit.Extra1            = string.Empty;
         infoUnit.Extra2            = string.Empty;
         if (CheckExistenceOfUnitName() == false)
         {
             if (spUnit.UnitEdit(infoUnit))
             {
                 Messages.UpdatedMessage();
                 Clear();
             }
         }
         else
         {
             Messages.InformationMessage("Already exists");
             txtUnitname.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("U4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Exemplo n.º 2
0
        public bool UnitEdit(UnitInfo infoUnit)
        {
            bool isCheck = false;

            try
            {
                isCheck = spUnit.UnitEdit(infoUnit);
            }
            catch (Exception ex)
            {
                MessageBox.Show("UBLL4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return(isCheck);
        }