Example #1
0
 //双击弹出修改
 private void dvM_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex >= 0 && dsFireInfo.Tables[0].Rows.Count > 0)
     {
         bsFireInfo.Position = e.RowIndex;
         IronLadleFireShowFrm Frm = new IronLadleFireShowFrm();
         Frm.ShowDialogEx(Adapter.Session, bsFireInfo.Position, strSort, ref dsFireInfo);
         GC.Collect();
     }
 }
Example #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 = dsFireInfo.Tables[0].NewRow();
                newrow["Input_Time"]      = DateTime.Now;
                newrow["IronLadleID"]     = "";
                newrow["Fire_Type"]       = "";
                newrow["FireID"]          = 0;
                newrow["Fire_Start_Time"] = DateTime.Now;
                newrow["Fire_End_Time"]   = DateTime.Now;
                newrow["Fire_Length"]     = 0;
                if (objShiftID != null && objTeamID != null)
                {
                    newrow["TeamID"]  = objTeamID.ToString();
                    newrow["ShiftID"] = objShiftID.ToString();
                }
                newrow["Operator"] = Adapter.Session.User;
                newrow["NOTE"]     = "";

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

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