Exemplo n.º 1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (dgv != null)
     {
         for (int i = 0; i < dgv.Rows.Count; i++)
         {
             INUnit _rs = new INUnit();
             _rs.Unit = dgv.Rows[i].Cells["Unit"].FormattedValue.ToString().Trim();
             if (_rs.Unit != "")
             {
                 _rs.Crtd_DateTime = DateTime.Now;
                 _rs.Crtd_Prog = this.strPro;
                 _rs.Crtd_User = Globals.PTUserName;
                 _rs.LUpd_DateTime = DateTime.Parse(dgv.Rows[i].Cells["LUpd_DateTime"].FormattedValue.ToString().Trim());
                 _rs.LUpd_Prog = dgv.Rows[i].Cells["LUpd_Prog"].FormattedValue.ToString().Trim();
                 _rs.LUpd_User = dgv.Rows[i].Cells["LUpd_User"].FormattedValue.ToString().Trim();
                 int kq;
                 kq = IN102Ctrl.SaveUnit(_rs);
             }
         }
         _BinGrid();
     }
 }
Exemplo n.º 2
0
 public static int SaveUnit(INUnit info)
 {
     return ConnectDB.ExecuteScalar("sp_UnitSave",
         new String[] {"Unit","Crtd_DateTime","Crtd_Prog","Crtd_User","LUpd_DateTime","LUpd_Prog","LUpd_User"},
         new Object[] { info.Unit, info.Crtd_DateTime, info.Crtd_Prog, info.Crtd_User, info.LUpd_DateTime, info.LUpd_Prog, info.LUpd_User});
 }