Exemplo n.º 1
0
 public void cmdEdit_Click()
 {
     if (MTGlobal.SetGridReadOnly(grid, tblView, false))
     {
         tblView.Focus();
         tblView.FocusedColumn = grid.Columns.First();
         tblView.ShowEditor();
         MTGlobal.SetButtonAction(MTROLE, MTButton, "EDIT");
     }
 }
Exemplo n.º 2
0
 public void cmdAbort_Click()
 {
     try
     {
         MTSQLServer.getMTSQLServer().Abort(SQLAdaptor, DSetMain.Tables[TABLE_NAME]);
         MTGlobal.SetGridReadOnly(grid, tblView, true);
         MTGlobal.SetButtonAction(MTROLE, MTButton, "ABORT");
     }
     catch { }
 }
Exemplo n.º 3
0
 public void cmdAdd_Click()
 {
     if (MTGlobal.SetGridReadOnly(grid, tblView, false))
     {
         tblView.NewItemRowPosition = DevExpress.Xpf.Grid.NewItemRowPosition.Bottom;
         tblView.FocusedRowHandle   = DevExpress.Xpf.Grid.GridControl.NewItemRowHandle;
         tblView.FocusedColumn      = columnFocus;
         tblView.Focus();
         tblView.ShowEditor();
         MTGlobal.SetButtonAction(MTROLE, MTButton, "ADD");
     }
 }
Exemplo n.º 4
0
 public String GridForm_Loaded()
 {
     try{
         showWaiting("Đang nạp dữ liệu...");
         string mSQL = string.Format(SQL_LOAD_ALL);
         SQLAdaptor = MTSQLServer.getMTSQLServer().wAdapter(mSQL, null, false);
         DSetMain   = new DataSet();
         SQLAdaptor.Fill(DSetMain, TABLE_NAME);
         DataTable dt = DSetMain.Tables[TABLE_NAME];
         totalRow         = dt.Rows.Count;
         grid.ItemsSource = dt;
         MTGlobal.SetGridReadOnly(grid, tblView, true);
         MTGlobal.SetFormatGridControl(grid, tblView);
         MTGlobal.SetPermit(ref MTROLE);
         MTGlobal.SetButtonAction(MTROLE, MTButton, "INIT");
     }
     catch (Exception ex) {
         closeWaiting();
         return(ex.Message.ToString());
     }
     closeWaiting();
     return(EMPTY);
 }
Exemplo n.º 5
0
 public String cmdSave_Click()
 {
     try{
         if (MTGlobal.MT_CURRENT_ACTION == "ADD" || MTGlobal.MT_CURRENT_ACTION == "EDIT")
         {
             if (MTSQLServer.getMTSQLServer().doSaveTable(SQLAdaptor, DSetMain.Tables[TABLE_NAME]))
             {
                 MTGlobal.SetGridReadOnly(grid, tblView, true);
                 MTGlobal.SetButtonAction(MTROLE, MTButton, "SAVE");
                 this.GridForm_Loaded();
                 return(Utils.SAVE_DB_OK);
             }
             else
             {
                 return(Utils.ERR_UPDATE_DB);
             }
         }
         return("");
     }
     catch (Exception ex) {
         return(ex.Message.ToString());
     }
 }