Example #1
0
        private void RetriveData()
        {
            try
            {
                if (ConditionLightResult == null)
                {
                    ConditionLightResult          = new sp_MAS306_GetConditionLight_Result();
                    ConditionLightResult.CRT_DATE = DateTime.Now;
                    this.ToolBarSwitch            = "2122222222";
                }
                else if (ConditionLightResult.DEL_ID.IsNull())
                {
                    this.ToolBarSwitch = "2122222102";
                }
                else
                {
                    this.ToolBarSwitch = "2022222012";
                }

                CtrlUtil.EnableControls(ConditionLightResult.DEL_ID.IsNull(), txtName, txtCode, txtSeq);

                bs.DataSource = ConditionLightResult;
            }
            catch (Exception ex)
            {
                rMessageBox.ShowException(this, ex);
            }
        }
Example #2
0
 private void CancelData(bool isCancel)
 {
     try
     {
         string msg;
         if (isCancel)
         {
             msg = MessageCode.CFM0003;
         }
         else
         {
             msg = MessageCode.CFM0004;
         }
         if (rMessageBox.ShowConfirmation(this, msg) == DialogResult.Yes)
         {
             vmMas.CancelConditionLight(ConditionLightResult, isCancel);
             if (isCancel)
             {
                 rMessageBox.ShowInfomation(this, MessageCode.INF0004);
             }
             else
             {
                 rMessageBox.ShowInfomation(this, MessageCode.INF0005);
             }
             this.IsDataChange    = true;
             ConditionLightResult = vmMas.GetConditionLight(ConditionLightResult.ID);
             RetriveData();
         }
     }
     catch (Exception ex)
     {
         rMessageBox.ShowException(this, ex);
     }
 }
Example #3
0
 private void SaveData()
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (ValidateBeforeSave())
         {
             if (rMessageBox.ShowConfirmation(this, MessageCode.CFM0001) == DialogResult.Yes)
             {
                 int ID = vmMas.SaveConditionLight(ConditionLightResult);
                 rMessageBox.ShowInfomation(this, MessageCode.INF0002);
                 this.IsDataChange    = true;
                 ConditionLightResult = vmMas.GetConditionLight(ID);
                 RetriveData();
             }
         }
     }
     catch (Exception ex)
     {
         rMessageBox.ShowException(this, ex);
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
Example #4
0
 private void EditData(DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0)
     {
         sp_MAS306_GetConditionLight_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_MAS306_GetConditionLight_Result;
         using (MAS306_ConditionLightEntry dlg = new MAS306_ConditionLightEntry(row))
         {
             if (dlg.ShowDialog(this) == DialogResult.OK)
             {
                 LoadData();
             }
         }
     }
 }
Example #5
0
 public MAS306_ConditionLightEntry(sp_MAS306_GetConditionLight_Result data)
 {
     InitializeComponent();
     ConditionLightResult = data;
 }
Example #6
0
 public void CancelConditionLight(sp_MAS306_GetConditionLight_Result data, bool ISCANCEL)
 {
     service.CancelConditionLight(data, ISCANCEL);
 }
Example #7
0
 public int SaveConditionLight(sp_MAS306_GetConditionLight_Result data)
 {
     return(service.SaveConditionLight(data));
 }