Exemplo n.º 1
0
 private void dvDetail_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && dsDetail.Tables[0].Rows.Count > 0)
     {
         bsDetail.Position = e.RowIndex;
         VacTubeFireInfoShowFrm FrmDetail = new VacTubeFireInfoShowFrm();
         FrmDetail.ShowDialogEx(Adapter.Session, bsDetail.Position, strSortDetail, ref dsDetail);
         GC.Collect();
     }
 }
Exemplo n.º 2
0
        private void btnAddDetail_Click(object sender, EventArgs e)
        {
            try
            {
                if (strInstallID == "")
                {
                    return;
                }

                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["Object_ID"]    = strObjectID;
                newrow["Install_ID"]   = strInstallID;
                newrow["Position"]     = strPosition;
                newrow["VacTube_Code"] = strVacTubeCode;
                //newrow["Up_Slot_ID"] = strUpID;
                //newrow["Bel_Slot_ID"] = strDownID;
                if (objShiftID != null && objTeamID != null)
                {
                    newrow["TeamID"]  = objTeamID.ToString();
                    newrow["ShiftID"] = objShiftID.ToString();
                }
                newrow["Log_Per"]     = Adapter.Session.User;
                newrow["FIRE_SORUCE"] = 1;

                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();
                }

                VacTubeFireInfoShowFrm FrmDetail = new VacTubeFireInfoShowFrm();
                FrmDetail.ShowDialogEx(Adapter.Session, bsDetail.Position, strSortDetail, ref dsDetail);
                GC.Collect();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }