示例#1
0
 /// <summary>
 /// Function to save
 /// </summary>
 public void SaveFunction()
 {
     try
     {
         BrandBll  BllBrand  = new BrandBll();
         BrandInfo infoBrand = new BrandInfo();
         infoBrand.BrandName    = txtBrandName.Text.Trim();
         infoBrand.Narration    = txtNarration.Text.Trim();;
         infoBrand.Manufacturer = txtManufacturer.Text.Trim();
         infoBrand.ExtraDate    = DateTime.Now;
         infoBrand.Extra1       = string.Empty;
         infoBrand.Extra2       = string.Empty;
         if (BllBrand.BrandCheckIfExist(txtBrandName.Text.Trim(), 0) == false)
         {
             decIdentity = BllBrand.BrandAdd(infoBrand);
             Messages.SavedMessage();
             Clear();
         }
         else
         {
             Messages.InformationMessage("Brand name already exist");
             txtBrandName.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("BR2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }