Exemple #1
0
 //修改详细信息
 private void dvDetail_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e)
 {
     if (e.RowIndex >= 0 && dsDetail.Tables[0].Rows.Count > 0)
     {
         bsDetail.Position = e.RowIndex;
         ComLadleRepShowFrm FrmDetail = new ComLadleRepShowFrm();
         FrmDetail.ShowDialogEx(Adapter.Session, strSortDetail, bsDetail.Position, ref dsDetail);
         GC.Collect();
     }
 }
Exemple #2
0
        //新增详细信息
        private void btnAddDetail_Click(object sender, EventArgs e)
        {
            if (strCurLadleID == "")
            {
                return;
            }
            int iRepID = 0;

            for (int i = 0; i < dsDetail.Tables[0].Rows.Count; i++)
            {
                int iCurID = Convert.ToInt32(dsDetail.Tables[0].Rows[i]["RepID"].ToString());
                if (iCurID >= iRepID)
                {
                    iRepID = iCurID;
                }
            }
            iRepID++;
            string strObjectID = strCurWorkID + iRepID.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["RepID"]           = iRepID;
            newrow["LadleID"]         = strCurLadleID;
            newrow["Rep_Date"]        = DateTime.Now.Date;
            newrow["WorkID"]          = strCurWorkID;
            newrow["Object_ID"]       = strObjectID;
            newrow["Fire_Start_Time"] = DateTime.Now;
            newrow["Fire_End_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();
            }
            ComLadleRepShowFrm FrmDetail = new ComLadleRepShowFrm();

            FrmDetail.ShowDialogEx(Adapter.Session, strSortDetail, bsDetail.Position, ref dsDetail);
            GC.Collect();
        }