Example #1
0
        //新增详细信息
        private void btnAddDetail_Click(object sender, EventArgs e)
        {
            try
            {
                if (strCurWorkID == "")
                {
                    return;
                }
                int iChaID = 0;
                for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
                {
                    int iCurID = Convert.ToInt32(dsDetail.Tables[0].Rows[i]["ChaID"].ToString());
                    if (iCurID >= iChaID)
                    {
                        iChaID = iCurID;
                    }
                }
                iChaID++;
                string strObjectID = strCurWorkID + iChaID.ToString();

                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 = dsDetail.Tables[0].NewRow();

                newrow["Input_Time"]         = DateTime.Now;
                newrow["ChaID"]              = iChaID;
                newrow["LadleID"]            = strCurLadleID;
                newrow["Cha_Slag_Line_Time"] = DateTime.Now;
                newrow["WorkID"]             = strCurWorkID;
                newrow["Object_ID"]          = strObjectID;
                newrow["Fire_Start_Time"]    = DateTime.Now;
                newrow["Fire_End_Time"]      = DateTime.Now;
                newrow["Thr_Ladle_Time"]     = DateTime.Now;
                if (objShiftID != null && objTeamID != null)
                {
                    newrow["TeamID"]  = objTeamID.ToString();
                    newrow["ShiftID"] = objShiftID.ToString();
                }
                newrow["Operator"] = Adapter.Session.User;
                newrow["Note"]     = "";

                dsDetail.Tables[0].Rows.Add(newrow);
                bsDetail.MoveFirst();

                while ((bsDetail.Current as System.Data.DataRowView).Row != newrow || bsDetail.Position < dsDetail.Tables[0].Rows.Count - 1)
                {
                    bsDetail.MoveNext();
                }
                FinLadleDreShowFrm FrmDetail = new FinLadleDreShowFrm();
                FrmDetail.ShowDialogEx(Adapter.Session, strSortDetail, bsDetail.Position, ref dsDetail);
                GC.Collect();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #2
0
 //修改详细信息
 private void dvDetail_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex >= 0 && dsDetail.Tables[0].Rows.Count > 0)
     {
         bsDetail.Position = e.RowIndex;
         FinLadleDreShowFrm FrmDetail = new FinLadleDreShowFrm();
         FrmDetail.ShowDialogEx(Adapter.Session, strSortDetail, bsDetail.Position, ref dsDetail);
         GC.Collect();
     }
 }