Exemple #1
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 = dsMain.Tables[0].NewRow();
                newrow["InPut_Time"]       = DateTime.Now;
                newrow["Build_Start_Time"] = DateTime.Now;
                newrow["Build_End_Time"]   = DateTime.Now;
                if (objShiftID != null && objTeamID != null)
                {
                    newrow["TeamID"]  = objTeamID.ToString();
                    newrow["ShiftID"] = objShiftID.ToString();
                }
                newrow["Operator"] = Adapter.Session.User;
                newrow["Note"]     = "";

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

                bsMain.MoveFirst();//
                while (((System.Data.DataRowView)(bsMain.Current)).Row != newrow && bsMain.Position != dsMain.Tables[0].Rows.Count - 1)
                {
                    bsMain.MoveNext();
                }
                HotSypBuildMagShowFrm frm = new HotSypBuildMagShowFrm();
                frm.ShowDialogEx(Adapter.Session, bsMain.Position, strSortMain, ref dsMain);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "异常", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Exemple #2
0
 //修改信息
 private void dvMain_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
 {
     if (e.RowIndex >= 0 && dsMain.Tables[0].Rows.Count > 0)
     {
         bsMain.Position = e.RowIndex;
         HotSypBuildMagShowFrm frm = new HotSypBuildMagShowFrm();
         frm.ShowDialogEx(Adapter.Session, bsMain.Position, strSortMain, ref dsMain);
     }
 }