void dgrdv_CellContentClick(object sender, DataGridViewCellEventArgs e) { int irow = e.RowIndex; int icol = e.ColumnIndex; if ((irow == -1) || (icol == -1)) { return; } int PrdID = (int)this.dtblPrds.DefaultView[irow]["PrdID"]; if (this.dgrdv.Columns[icol].Name == this.ColumnMark.Name) { if (this.frmOper == null) { this.frmOper = new FrmProductOper(); new FrmStyle(frmOper).SetPopFrmStyle(this); this.frmOper.AffterSave += this.LoadData; } this.frmOper.Edit(PrdID); this.frmOper.ShowDialog(); } if (this.dgrdv.Columns[icol].Name == this.ColumnPrdSetCount.Name) { if (frmPrdSetOper == null) { frmPrdSetOper = new FrmPrdSetOper(); new FrmStyle(frmPrdSetOper).SetPopFrmStyle(this); frmPrdSetOper.AffterSave += new FrmPrdSetOper.AffterSaveDelegate(frmSetBomOper_AffterSave); } frmPrdSetOper.PrdSetBomOper(PrdID); frmPrdSetOper.ShowDialog(); } string errormsg = string.Empty; if (this.dgrdv.Columns[icol].Name == this.ColumnFileCount.Name) { if (frmFileBrowse == null) { frmFileBrowse = new JCommon.FrmFileBrowse(); frmFileBrowse.ReadOnly = !this.enableSave; new FrmStyle(frmFileBrowse).SetPopFrmStyle(this); } frmFileBrowse.Browse(JERPData.ServerParameter.ERPFileFolder + @"\Product\PrdFile\" + PrdID.ToString()); frmFileBrowse.ShowDialog(); this.dgrdv[icol, irow].Value = frmFileBrowse.Count; this.accPrds.UpdateProductForFileCount( ref errormsg, PrdID, frmFileBrowse.Count); } if (this.dgrdv.Columns[icol].Name == this.ColumnImgCount.Name) { if (frmImgBrowse == null) { frmImgBrowse = new JCommon.FrmImgBrowse(); frmImgBrowse.ReadOnly = !this.enableSave; new FrmStyle(frmImgBrowse).SetPopFrmStyle(this); } frmImgBrowse.Browse(JERPData.ServerParameter.ERPFileFolder + @"\Product\PrdImg\" + PrdID.ToString()); frmImgBrowse.ShowDialog(); this.dgrdv[icol, irow].Value = frmImgBrowse.Count; this.accPrds.UpdateProductForImgCount(ref errormsg, PrdID, frmImgBrowse.Count); } }
void dgrdvOnjob_CellContentClick(object sender, DataGridViewCellEventArgs e) { int irow = e.RowIndex; int icol = e.ColumnIndex; if ((irow == -1) || (icol == -1)) { return; } DataRow drow = this.dtblPsnOnjob.DefaultView[irow].Row; object objPsnID = drow["PsnID"]; if ((objPsnID == null) || (objPsnID == DBNull.Value)) { return; } string errormsg = string.Empty; if (this.dgrdvOnjob.Columns[icol].Name == this.ColumnbtnOffjob.Name) { if (this.dgrdvOnjob.Rows [irow].IsNewRow) { return; } DateTime DateDismiss = DateTime.Now.Date; JCommon.FrmSetDateTime.ShowDialog(ref DateDismiss); this.accPsns.UpdatePersonnelForOffjob(ref errormsg, objPsnID, DateDismiss); this.dgrdvOnjob.Rows.RemoveAt(irow); this.LoadOffjob(); } if (this.dgrdvOnjob.Columns[icol].Name == this.ColumnSignImgCount.Name) { if (frmImgBrowse == null) { frmImgBrowse = new JCommon.FrmImgBrowse(); frmImgBrowse.ReadOnly = !this.enableSave; new FrmStyle(frmImgBrowse).SetPopFrmStyle(this); } frmImgBrowse.Browse(JERPData.ServerParameter.ERPFileFolder + @"\Hr\SignImg\" + objPsnID.ToString()); frmImgBrowse.ShowDialog(); this.dgrdvOnjob[icol, irow].Value = frmImgBrowse.Count; this.accPsns.UpdatePersonnelForSignImgCount(ref errormsg, objPsnID, frmImgBrowse.Count); } if (this.dgrdvOnjob.Columns[icol].Name == this.ColumnPortraitImgCount.Name) { if (frmImgBrowse == null) { frmImgBrowse = new JCommon.FrmImgBrowse(); frmImgBrowse.ReadOnly = !this.enableSave; new FrmStyle(frmImgBrowse).SetPopFrmStyle(this); } frmImgBrowse.Browse(JERPData.ServerParameter.ERPFileFolder + @"\Hr\PortraitImg\" + objPsnID.ToString()); frmImgBrowse.ShowDialog(); this.dgrdvOnjob[icol, irow].Value = frmImgBrowse.Count; this.accPsns.UpdatePersonnelForPortraitImgCount(ref errormsg, objPsnID, frmImgBrowse.Count); } }