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

                CtrlUtil.EnableControls(InstitutionResult.DEL_ID.IsNull(), txtName, txtShortName, txtEditionName, txtPageFrom, txtPageTo, txtSeq);

                bdSource.DataSource = InstitutionResult;
            }
            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.CancelInstitutionSTD(InstitutionResult, isCancel);
             if (isCancel)
             {
                 rMessageBox.ShowInfomation(this, MessageCode.INF0004);
             }
             else
             {
                 rMessageBox.ShowInfomation(this, MessageCode.INF0005);
             }
             this.IsDataChange = true;
             InstitutionResult = vmMas.GetInstitutionSTD(InstitutionResult.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.SaveInstitutionSTD(InstitutionResult);
                 rMessageBox.ShowInfomation(this, MessageCode.INF0002);
                 this.IsDataChange = true;
                 InstitutionResult = vmMas.GetInstitutionSTD(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_MAS307_GetInstitutionSTD_Result row = gvResult.Rows[e.RowIndex].DataBoundItem as sp_MAS307_GetInstitutionSTD_Result;
         using (MAS307_InstitutionStandardEntry dlg = new MAS307_InstitutionStandardEntry(row))
         {
             if (dlg.ShowDialog(this) == DialogResult.OK)
             {
                 LoadData();
             }
         }
     }
 }
Example #5
0
 public void CancelInstitutionSTD(sp_MAS307_GetInstitutionSTD_Result data, bool ISCANCEL)
 {
     service.CancelInstitutionSTD(data, ISCANCEL);
 }
Example #6
0
 public int SaveInstitutionSTD(sp_MAS307_GetInstitutionSTD_Result data)
 {
     return(service.SaveInstitutionSTD(data));
 }
Example #7
0
 public MAS307_InstitutionStandardEntry(sp_MAS307_GetInstitutionSTD_Result data)
 {
     InitializeComponent();
     InstitutionResult = data;
 }