/// <summary> /// m_mthQCAnalysisMonth /// </summary> /// <param name="p_dtMonth"></param> private void m_mthQCAnalysisMonth(DateTime p_dtMonth) { if (!this.m_objBatch.IsNull) { if (this.m_objBatch.Count == 1) { DateTime t = Convert.ToDateTime(p_dtMonth.ToString("yyyy-MM")); DateTime t2 = p_dtMonth.AddMonths(1).AddSeconds(-1.0); List <clsLisQCReportVO> objReports = this.m_objBatch.m_objReports; clsLisQCReportVO clsLisQCReportVO = null; for (int i = 0; i < objReports.Count; i++) { clsLisQCReportVO clsLisQCReportVO2 = objReports[i]; if (objReports[i].m_intReportStats == 1) { if (clsLisQCReportVO2.m_dtReport >= t && clsLisQCReportVO2.m_dtReport <= t2) { clsLisQCReportVO = clsLisQCReportVO2; break; } } } frmQCReport frmQCReport; if (clsLisQCReportVO != null) { frmQCReport = new frmQCReport(clsLisQCReportVO); frmQCReport.m_blIsDate = false; } else { frmQCReport = new frmQCReport(this.m_objBatch.SeqArr[0], p_dtMonth); frmQCReport.m_blIsDate = false; frmQCReport.BrokenRules = this.m_objBatch.BrokenRules; frmQCReport.m_lblSeq.Text = "质控批序号:" + this.m_objBatch.SeqArr[0].ToString(); } if (frmQCReport.ShowDialog() == DialogResult.OK) { clsLisQCReportVO report = frmQCReport.Report; if (clsLisQCReportVO == null) { this.m_objBatch.m_objReports.Add(report); } else { report.m_mthCopyTo(clsLisQCReportVO); } } } } }
private void m_cmdModify_Click(object sender, EventArgs e) { if (this.m_lsvReport.SelectedItems.Count > 0) { ListViewItem item = this.m_lsvReport.SelectedItems[0]; clsLisQCReportVO temp = new clsLisQCReportVO(); clsLisQCReportVO curr = item.Tag as clsLisQCReportVO; curr.m_mthCopyTo(temp); frmQCReport frm = new frmQCReport(temp); frm.BrokenRules = this.m_objQCBatch.BrokenRules; if (frm.ShowDialog() == DialogResult.OK) { clsLisQCReportVO var = frm.Report; var.m_mthCopyTo(curr); this.m_mthListViewItemChange(curr, item); } } }
/// <summary> /// m_btnSave_Click /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void m_btnSave_Click(object sender, EventArgs e) { //long lngRes = 0; //clsLisQCReportVO var = null; //if (this.m_blnNew) //{//新增 // var = new clsLisQCReportVO(); // this.m_mthBindControlValueToObj(var); // var.m_intSeq = DBAssist.NullInt; // var.m_intQCBatchSeq = this.m_intQCBatchSeq; // var.m_enmStatus = enmQCStatus.Natrural; // lngRes = clsTmdQCReportSmp.s_object.m_lngInsert(var); // if (lngRes > 0) // { // this.m_objReport = var; // this.m_blnNew = false; // } //} //else //{//修改 // var = new clsLisQCReportVO(); // this.m_objReport.m_mthCopyTo(var); // this.m_mthBindControlValueToObj(var); // lngRes = clsTmdQCReportSmp.s_object.m_lngUpdate(var); // if (lngRes > 0) // { // var.m_mthCopyTo(this.m_objReport); // } //} //if (lngRes <= 0) //{ // clsCommonDialog.m_mthShowDBError(); // return; //} //this.m_blnOK = true; //this.Close(); long num = 0L; if (this.m_blnNew) { if (this.m_blIsDate) { clsLisQCReportVO QCReportVO = new clsLisQCReportVO(); this.m_mthBindControlValueToObj(QCReportVO); QCReportVO.m_intSeq = -2147483648; QCReportVO.m_intQCBatchSeq = this.m_intQCBatchSeq; QCReportVO.m_enmStatus = enmQCStatus.Natrural; QCReportVO.m_intReportStats = 0; num = this.m_objDomain.m_lngInsertQCReport(QCReportVO, out QCReportVO.m_intSeq); if (num > 0L) { this.m_objReport = QCReportVO; this.m_blnNew = false; } } else { clsLisQCReportVO QCReportVO = new clsLisQCReportVO(); this.m_mthBindControlValueToObj(QCReportVO); QCReportVO.m_intSeq = -2147483648; QCReportVO.m_intQCBatchSeq = this.m_intQCBatchSeq; QCReportVO.m_enmStatus = enmQCStatus.Natrural; QCReportVO.m_intReportStats = 1; num = this.m_objDomain.m_lngInsertQCReport(QCReportVO, out QCReportVO.m_intSeq); if (num > 0L) { this.m_objReport = QCReportVO; this.m_blnNew = false; } } } else { clsLisQCReportVO QCReportVO = new clsLisQCReportVO(); this.m_objReport.m_mthCopyTo(QCReportVO); this.m_mthBindControlValueToObj(QCReportVO); QCReportVO.m_intReportStats = this.m_objReport.m_intReportStats; num = this.m_objDomain.m_lngUpdateQCReport(QCReportVO); if (num > 0L) { QCReportVO.m_mthCopyTo(this.m_objReport); } } if (num <= 0L) { clsCommonDialog.m_mthShowDBError(); } else { this.m_blnOK = true; this.Close(); } }