コード例 #1
0
 private void Stopping_CellValueChanging(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e)
 {
     if (e.Column.Name.ToString() == "gcLocked")
     {
         DataRow dr = Stopping.GetFocusedDataRow();
         dr["locked"] = e.Value;
         if (Convert.ToBoolean(e.Value))
         {
             dr["Lkg"]        = dr["Pkg"];
             dr["Diffkg"]     = 0;
             dr["LCubics"]    = dr["PCubics"];
             dr["DiffCubics"] = 0;
             dr["Lcmgt"]      = dr["Pcmgt"];
             dr["LSQM"]       = dr["PSQM"];
             dr["LOnSQM"]     = dr["POnSQM"];
             dr["LOffSQM"]    = dr["POffSQM"];
             dr["DiffSQM"]    = 0;
             dr["LUkg"]       = dr["PUkg"];
             dr["DiffUkg"]    = 0;
         }
         else
         {
             dr["Lkg"]        = 0;
             dr["Diffkg"]     = Convert.ToDecimal(dr["Pkg"].ToString()) - Convert.ToDecimal(dr["Lkg"].ToString());
             dr["LCubics"]    = 0;
             dr["DiffCubics"] = Convert.ToDecimal(dr["PCubics"].ToString()) - Convert.ToDecimal(dr["LCubics"].ToString());
             dr["Lcmgt"]      = 0;
             dr["LSQM"]       = 0;
             dr["LOnSQM"]     = 0;
             dr["LOffSQM"]    = 0;
             dr["DiffSQM"]    = Convert.ToDecimal(dr["PSQM"].ToString()) - Convert.ToDecimal(dr["LSQM"].ToString());
             dr["LUkg"]       = 0;
             dr["DiffUkg"]    = Convert.ToDecimal(dr["PUkg"].ToString()) - Convert.ToDecimal(dr["LUkg"].ToString());
         }
     }
 }