Example #1
0
 private void Save()
 {
     Atend.Base.Equipment.EProp Prop = new Atend.Base.Equipment.EProp();
     Prop.Name        = txtName.Text;
     Prop.ProductCode = Atend.Control.Common.selectedProductCode;
     Prop.IsDefault   = IsDefault;
     Prop.Code        = 0;
     if (SelectedPropXCode == Guid.Empty)
     {
         if (Prop.InsertX())
         {
             Reset();
         }
         else
         {
             MessageBox.Show("امکان ثبت اطلاعات نمی باشد", "خطا");
         }
     }
     else
     {
         Prop.XCode = SelectedPropXCode;
         Prop.Code  = Code;
         if (Prop.UpdateX())
         {
             Reset();
         }
         else
         {
             MessageBox.Show("امکان به روز رسانی اطلاعات نمی باشد", "خطا");
         }
     }
 }