Пример #1
0
 public bool LValidateSave()
 {
     try
     {
         errorProvider1.Clear();
         bool _LValidateSave = true;
         if (!ClsUtility._IClsUtility.LValidateTextBox(RdTxtUnitCode, errorProvider1, "Unit Code Cannot Be Left Blank."))
         {
             _LValidateSave = false;
         }
         else if (!ClsUtility._IClsUtility.LValidateTextBox(RdTxtUnitDescription, errorProvider1, "Unit Description Cannot Be Left Blank."))
         {
             _LValidateSave = false;
         }
         else if (ClsUtility._IClsUtility.FormMode == ClsUtility.enmFormMode.AddMode && ClsUtility._IClsUtility.IsCodeExists("A3DIMS.dbo.MUnit", "cUnitCode", RdTxtUnitCode.Text.Trim(), "Unit Code Already Exists!!"))
         {
             errorProvider1.SetError(RdTxtUnitCode, "Unit Code Already Exists!!");
             RdTxtUnitCode.Focus();
             _LValidateSave = false;
         }
         return(_LValidateSave);
     }
     catch (Exception ex)
     {
         ClsMessage._IClsMessage.ProjectExceptionMessage(ex);
         return(false);
     }
 }
Пример #2
0
        public void SetFormMode(ClsUtility.enmFormMode _FormMode)
        {
            switch (_FormMode)
            {
            case ClsUtility.enmFormMode.AddMode:
                SetEnable(true);
                RdTxtUnitCode.Focus();
                break;

            case ClsUtility.enmFormMode.EditMode:
                SetEnable(true);
                RdTxtUnitCode.Enabled = false;
                break;

            case ClsUtility.enmFormMode.NormalMode:
                SetEnable(false);
                break;
            }
        }