Esempio n. 1
0
 //修改信息
 private void dvM_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex >= 0 && dsUse.Tables[0].Rows.Count > 0)
     {
         bsUse.Position = e.RowIndex;
         LadleUseMagShowFrm Frm = new LadleUseMagShowFrm();
         int iRow = dsUse.Tables[0].Rows.IndexOf(((System.Data.DataRowView)(bsUse.Current)).Row);
         if (Convert.ToBoolean(dsUse.Tables[0].Rows[iRow]["ComFlag"]))
         {
             Frm.ShowDialogEx(Adapter.Session, strSort, true, bsUse.Position, ref dsUse);
         }
         else
         {
             Frm.ShowDialogEx(Adapter.Session, strSort, false, bsUse.Position, ref dsUse);
         }
         GC.Collect();
     }
 }
Esempio n. 2
0
        //新增信息
        private void btnAdd_Click(object sender, EventArgs e)
        {
            try
            {
                Adapter.Session.Get(CommDataMag.CommonData.CCURRENT_SHIFT_INFO_OBJ, "ShiftID", ref objShiftID);
                Adapter.Session.Get(CommDataMag.CommonData.CCURRENT_SHIFT_INFO_OBJ, "TeamID", ref objTeamID);

                DataRow newrow = dsUse.Tables[0].NewRow();

                newrow["Input_Time"]     = DateTime.Now;
                newrow["Use_Date"]       = DateTime.Now.Date.ToString();
                newrow["Seat_OK_Time"]   = DateTime.Now;
                newrow["Off_Ladle_Time"] = DateTime.Now;
                newrow["Arrive_Time"]    = DateTime.Now;
                newrow["Complete_Time"]  = DateTime.Now;
                newrow["ComFlag"]        = 0;
                newrow["Wall_Temp"]      = 0;
                if (objShiftID != null && objTeamID != null)
                {
                    newrow["TeamID"]  = objTeamID.ToString();
                    newrow["ShiftID"] = objShiftID.ToString();
                }
                newrow["Operator"] = Adapter.Session.User;

                dsUse.Tables[0].Rows.Add(newrow);

                bsUse.MoveFirst();
                while (((System.Data.DataRowView)(bsUse.Current)).Row != newrow && bsUse.Position != dsUse.Tables[0].Rows.Count - 1)
                {
                    bsUse.MoveNext();
                }
                LadleUseMagShowFrm Frm = new LadleUseMagShowFrm();
                Frm.ShowDialogEx(Adapter.Session, strSort, false, bsUse.Position, ref dsUse);
                GC.Collect();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }