//IList<Model.ANSIPCImpactCheckDetail> details = new List<Model.ANSIPCImpactCheckDetail>(); //BL.ANSIPCImpactCheckDetailManager ansipcicManager = new Book.BL.ANSIPCImpactCheckDetailManager(); public RO(Model.PCFogCheck mPCFogC) { InitializeComponent(); if (mPCFogC == null) { return; } this.DataSource = mPCFogC.Details; //details = ansipcicManager.SelectByAnispcicID(ANSIPCIC.ANSIPCImpactCheckID); //this.DataSource = details; //CompanyInfo this.lblCompanyName.Text = BL.Settings.CompanyChineseName; this.lblDataName.Text = Properties.Resources.PCFogCheck; //this.lblPriteDate.Text += DateTime.Now.ToShortDateString(); //Control this.lblPCFogCheckId.Text = mPCFogC.PCFogCheckId; this.lblPCFogCheckDate.Text = mPCFogC.PCFogCheckDate.HasValue ? mPCFogC.PCFogCheckDate.Value.ToShortDateString() : ""; this.lblInvoiceCusXOId.Text = mPCFogC.InvoiceCusXOId; this.lblPronoteHeaderId.Text = mPCFogC.PronoteHeaderId; this.lblProduct.Text = mPCFogC.Product == null ? "" : mPCFogC.Product.ToString(); this.lblEmployee.Text = mPCFogC.Employee == null ? "" : mPCFogC.Employee.ToString(); this.RTDescript.Text = mPCFogC.PCFogCheckDesc; this.lblCheckStandard.Text = mPCFogC.mCheckStandard; this.lblPCFogCheckQuantity.Text = mPCFogC.PCFogCheckQuantity.HasValue ? mPCFogC.PCFogCheckQuantity.ToString() : ""; this.lblInvoiceXOQuantity.Text = mPCFogC.InvoiceXOQuantity.HasValue ? mPCFogC.InvoiceXOQuantity.ToString() : ""; this.ChkIsPassWuDu.Checked = mPCFogC.IsFogPassing.HasValue ? mPCFogC.IsFogPassing.Value : false; this.lbl_productunit.Text = mPCFogC.ProductUnit == null ? "" : mPCFogC.ProductUnit.ToString(); this.lbl_MaterailUnit.Text = mPCFogC.MaterialUnit; //this.lbl_CustomerProductName.Text = mPCFogC.Product == null ? "" : mPCFogC.Product.CustomerProductName; if (mPCFogC.Product != null) { if (string.IsNullOrEmpty(mPCFogC.Product.CustomerProductName)) { this.lbl_CustomerProductName.Text = CommonHelp.GetCustomerProductNameByPronoteHeaderId(mPCFogC.PronoteHeaderId, mPCFogC.ProductId); } else { this.lbl_CustomerProductName.Text = mPCFogC.Product.CustomerProductName; } } //Details this.TCChkPassL.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingL); this.TCChkPassR.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingR); this.TClblCL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCL); this.TClblCR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCR); this.TClblCommentL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentLTime, "{0:yyyy-MM-dd HH:mm}"); this.TClblCommentR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentRTime, "{0:yyyy-MM-dd HH:mm}"); this.TClblHL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHL); this.TClblHR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHR); this.TClblTL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTL); this.TClblTR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTR); this.TClblMethod.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_Method); xrLBusinessHours.DataBindings.Add("Text", this.DataSource, "BusinessHours." + Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME); this.TCCheckStandard.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CheckStandard); }
protected override void MoveNext() { Model.PCFogCheck mPCFog = this._pcfogManager.GetNext(this._pcfog); if (mPCFog == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this._pcfog = this._pcfogManager.Get(mPCFog.PCFogCheckId); }
protected override void MoveLast() { if (this.LastFlag == 1) { this.LastFlag = 0; return; } this._pcfog = this._pcfogManager.GetLast(); }
public EditForm(Model.PCFogCheck mPCFogCheck, string action) : this() { this._pcfog = mPCFogCheck; this.action = action; if (this.action == "view") { LastFlag = 1; } }
public override void Refresh() { if (this._pcfog == null) { this.AddNew(); this.action = "insert"; } else { if (this.action == "view") { this._pcfog = this._pcfogManager.GetDetail(this._pcfog.PCFogCheckId); } } //初始化控件 this.txtPCFogCheckId.Text = this._pcfog.PCFogCheckId; this.txtPronoteHeaderId.Text = this._pcfog.PronoteHeaderId; this.txtInvoiceCusXOId.Text = this._pcfog.InvoiceCusXOId; this.txtPCFogCheckDesc.Text = this._pcfog.PCFogCheckDesc; this.ceInvoiceXOCount.Text = (this._pcfog.InvoiceXOQuantity.HasValue ? this._pcfog.InvoiceXOQuantity.Value : 0).ToString(); this.calcPCFogCheckQuantity.EditValue = this._pcfog.PCFogCheckQuantity.HasValue ? this._pcfog.PCFogCheckQuantity.Value : 0; this.DE_PCFogCheckDate.EditValue = this._pcfog.PCFogCheckDate.Value; this.BEProduct.EditValue = this._pcfog.Product; this.nccEmployee0.EditValue = this._pcfog.Employee; this.txtCheckedStandard.Text = this._pcfog.mCheckStandard; this.chkEditWDCS.Checked = this._pcfog.IsFogPassing.HasValue ? this._pcfog.IsFogPassing.Value : false; this.newChooseContorlAuditEmp.EditValue = this._pcfog.AuditEmp; this.txt_AuditState.EditValue = this.GetAuditName(this._pcfog.AuditState); this.lookUpEditUnit.EditValue = this._pcfog.ProductUnitId; this.cob_MaterailUnit.Text = this._pcfog.MaterialUnit; this.bindingSource1.DataSource = this._pcfog.Details; base.Refresh(); switch (this.action) { case "insert": this.gridView1.OptionsBehavior.Editable = true; break; case "update": this.gridView1.OptionsBehavior.Editable = true; break; case "view": this.gridView1.OptionsBehavior.Editable = false; break; } this.txtPCFogCheckId.Properties.ReadOnly = true; this.ceInvoiceXOCount.Enabled = false; this.txtPCFogCheckId.Enabled = false; }
private void btn_OK_Click(object sender, EventArgs e) { IList <Model.PCFogCheck> list = this.bindingSource1.DataSource as IList <Model.PCFogCheck>; if (list != null) { Model.PCFogCheck pcFogCheck = list.FirstOrDefault(P => P.IsChecked == true); if (pcFogCheck != null) { this.PCFogCheckId = pcFogCheck.PCFogCheckId; } } this.DialogResult = DialogResult.OK; }
public EditForm(string invoiceId) : this() { this._pcfog = this._pcfogManager.Get(invoiceId); if (this._pcfog == null) { throw new ArithmeticException("invoiceid"); } this.action = "view"; if (this.action == "view") { LastFlag = 1; } }
public EditForm(Model.PCFogCheck mPCFogCheck) : this() { if (mPCFogCheck == null) { throw new ArithmeticException("invoiceid"); } this._pcfog = mPCFogCheck; this.action = "view"; if (this.action == "view") { LastFlag = 1; } }
//选择测试单据 private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) { ListForm f = new ListForm(); if (f.ShowDialog(this) == DialogResult.OK) { Model.PCFogCheck currentModel = f.SelectItem as Model.PCFogCheck; if (currentModel != null) { this._pcfog = currentModel; this._pcfog = this._pcfogManager.GetDetail(this._pcfog.PCFogCheckId); this.Refresh(); } } f.Dispose(); GC.Collect(); }
protected override void AddNew() { this._pcfog = new Book.Model.PCFogCheck(); this._pcfog.PCFogCheckId = this._pcfogManager.GetId(); this._pcfog.PCFogCheckDate = DateTime.Now.Date; this._pcfog.PCFogCheckQuantity = 1; //默认检测数量为1 this._pcfog.Details = new List <Model.PCFogCheckDetail>(); Model.PCFogCheckDetail pcfcd = new Book.Model.PCFogCheckDetail(); pcfcd.PCImpactCheckDetailId = Guid.NewGuid().ToString(); pcfcd.PCFogCheckId = this._pcfog.PCFogCheckId; pcfcd.CommentLDate = DateTime.Now; pcfcd.CommentLTime = DateTime.Now; pcfcd.CommentRDate = DateTime.Now; pcfcd.CommentRTime = DateTime.Now; this._pcfog.Details.Add(pcfcd); }
public void Delete(Model.PCFogCheck pcfc) { try { BL.V.BeginTransaction(); new BL.PCFogCheckDetailManager().DeleteByHeaderId(pcfc.PCFogCheckId); this.Delete(pcfc.PCFogCheckId); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
private void TiGuiExists(Model.PCFogCheck model) { if (this.ExistsPrimary(model.PCFogCheckId)) { //设置KEY值 string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, model.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, model.InsertTime.Value.Year, model.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, model.InsertTime.Value.ToString("yyyy-MM-dd")); string sequencekey = string.Format(invoiceKind); SequenceManager.Increment(sequencekey_y); SequenceManager.Increment(sequencekey_m); SequenceManager.Increment(sequencekey_d); SequenceManager.Increment(sequencekey); model.PCFogCheckId = this.GetId(model.InsertTime.Value); TiGuiExists(model); } }
public void Update(Model.PCFogCheck pCFogCheck) { if (pCFogCheck != null) { Validate(pCFogCheck); pCFogCheck.UpdateTime = DateTime.Now; accessor.Update(pCFogCheck); new PCFogCheckDetailManager().DeleteByHeaderId(pCFogCheck.PCFogCheckId); foreach (Model.PCFogCheckDetail d in pCFogCheck.Details) { new PCFogCheckDetailManager().Insert(d); } } }
//IList<Model.ANSIPCImpactCheckDetail> details = new List<Model.ANSIPCImpactCheckDetail>(); //BL.ANSIPCImpactCheckDetailManager ansipcicManager = new Book.BL.ANSIPCImpactCheckDetailManager(); public RO(Model.PCFogCheck mPCFogC) { InitializeComponent(); if (mPCFogC == null) { return; } this.DataSource = mPCFogC.Details; //details = ansipcicManager.SelectByAnispcicID(ANSIPCIC.ANSIPCImpactCheckID); //this.DataSource = details; //CompanyInfo this.lblCompanyName.Text = BL.Settings.CompanyChineseName; this.lblDataName.Text = Properties.Resources.PCFogCheck; this.lblPriteDate.Text += DateTime.Now.ToShortDateString(); //Control this.lblPCFogCheckId.Text = mPCFogC.PCFogCheckId; this.lblPCFogCheckDate.Text = mPCFogC.PCFogCheckDate.HasValue ? mPCFogC.PCFogCheckDate.Value.ToShortDateString() : ""; this.lblInvoiceCusXOId.Text = mPCFogC.InvoiceCusXOId; this.lblPronoteHeaderId.Text = mPCFogC.PronoteHeaderId; this.lblProduct.Text = mPCFogC.Product == null ? "" : mPCFogC.Product.ToString(); this.lblEmployee.Text = mPCFogC.Employee == null ? "" : mPCFogC.Employee.ToString(); this.RTDescript.Text = mPCFogC.PCFogCheckDesc; this.lblCheckStandard.Text = mPCFogC.mCheckStandard; this.lblPCFogCheckQuantity.Text = mPCFogC.PCFogCheckQuantity.HasValue ? mPCFogC.PCFogCheckQuantity.ToString() : ""; this.lblInvoiceXOQuantity.Text = mPCFogC.InvoiceXOQuantity.HasValue ? mPCFogC.InvoiceXOQuantity.ToString() : ""; this.ChkIsPassWuDu.Checked = mPCFogC.IsFogPassing.HasValue ? mPCFogC.IsFogPassing.Value : false; this.lbl_productunit.Text = mPCFogC.ProductUnit == null ? "" : mPCFogC.ProductUnit.ToString(); //Details this.TCChkPassL.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingL); this.TCChkPassR.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingR); this.TClblCL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCL); this.TClblCR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCR); this.TClblCommentL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentLTime); this.TClblCommentR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentRTime); this.TClblHL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHL); this.TClblHR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHR); this.TClblTL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTL); this.TClblTR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTR); this.TClblMethod.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_Method); }
protected override void Delete() { if (this._pcfog == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } this._pcfogManager.Delete(this._pcfog); this._pcfog = this._pcfogManager.GetNext(this._pcfog); if (this._pcfog == null) { this._pcfog = this._pcfogManager.GetLast(); } }
public void Update(Model.PCFogCheck pCFogCheck) { if (pCFogCheck != null) { Validate(pCFogCheck); pCFogCheck.UpdateTime = DateTime.Now; accessor.Update(pCFogCheck); this._pcfogcheckdetailmanager.DeleteByHeaderId(pCFogCheck.PCFogCheckId); foreach (Model.PCFogCheckDetail d in pCFogCheck.Details) { d.PCFogCheckId = pCFogCheck.PCFogCheckId; this._pcfogcheckdetailmanager.Insert(d); } } }
protected override void AddNew() { this._pcfog = new Book.Model.PCFogCheck(); this._pcfog.PCFogCheckId = this._pcfogManager.GetId(); this._pcfog.PCFogCheckDate = DateTime.Now.Date; this._pcfog.PCFogCheckQuantity = 6; //默认检测数量为1 this._pcfog.ProductUnitId = "f7f95879-3444-494b-92eb-2aa784c52e8c"; //默认单位PCS this._pcfog.Details = new List <Model.PCFogCheckDetail>(); Model.PCFogCheckDetail pcfcd = new Book.Model.PCFogCheckDetail(); pcfcd.PCImpactCheckDetailId = Guid.NewGuid().ToString(); pcfcd.PCFogCheckId = this._pcfog.PCFogCheckId; pcfcd.CommentLDate = DateTime.Now; pcfcd.CommentLTime = DateTime.Now; pcfcd.CommentRDate = DateTime.Now; pcfcd.CommentRTime = DateTime.Now; pcfcd.CheckStandard = this.repositoryItemComboBox1.Items[0].ToString(); this._pcfog.Details.Add(pcfcd); }
private void Validate(Model.PCFogCheck mPCFog) { if (string.IsNullOrEmpty(mPCFog.PCFogCheckId)) { throw new Helper.RequireValueException(Model.PCFogCheck.PRO_PCFogCheckId); } if (string.IsNullOrEmpty(mPCFog.ProductId)) { throw new Helper.RequireValueException(Model.PCFogCheck.PRO_ProductId); } if (string.IsNullOrEmpty(mPCFog.PCFogCheckDate.ToString())) { throw new Helper.RequireValueException(Model.PCFogCheck.PRO_PCFogCheckDate); } if (string.IsNullOrEmpty(mPCFog.EmployeeId)) { throw new Helper.RequireValueException(Model.PCFogCheck.PRO_EmployeeId); } }
public void Insert(Model.PCFogCheck pCFogCheck) { Validate(pCFogCheck); try { BL.V.BeginTransaction(); pCFogCheck.InsertTime = DateTime.Now; pCFogCheck.UpdateTime = DateTime.Now; TiGuiExists(pCFogCheck); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, pCFogCheck.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, pCFogCheck.InsertTime.Value.Year, pCFogCheck.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, pCFogCheck.InsertTime.Value.ToString("yyyy-MM-dd")); string sequencekey = string.Format(invoiceKind); SequenceManager.Increment(sequencekey_y); SequenceManager.Increment(sequencekey_m); SequenceManager.Increment(sequencekey_d); SequenceManager.Increment(sequencekey); accessor.Insert(pCFogCheck); foreach (Model.PCFogCheckDetail d in pCFogCheck.Details) { d.PCFogCheckId = pCFogCheck.PCFogCheckId; new PCFogCheckDetailManager().Insert(d); } BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
public Model.PCFogCheck GetPrev(Model.PCFogCheck e) { return(sqlmapper.QueryForObject <Model.PCFogCheck>("PCFogCheck.get_prev", e)); }
public bool HasRowsAfter(Model.PCFogCheck e) { return(sqlmapper.QueryForObject <bool>("PCFogCheck.has_rows_after", e)); }
public bool HasRowsAfter(Model.PCFogCheck e) { return(accessor.HasRowsAfter(e)); }
public bool HasRowsBefore(Model.PCFogCheck e) { return(accessor.HasRowsBefore(e)); }
public Model.PCFogCheck GetNext(Model.PCFogCheck e) { return(accessor.GetNext(e)); }
public Model.PCFogCheck GetPrev(Model.PCFogCheck e) { return(accessor.GetPrev(e)); }
public Model.PCFogCheck GetDetail(string PCFogCheckId) { Model.PCFogCheck p = accessor.Get(PCFogCheckId); p.Details = this._pcfogcheckdetailmanager.Select(PCFogCheckId); return(p); }
protected override void MoveFirst() { this._pcfog = this._pcfogManager.GetFirst(); }
public bool HasRowsBefore(Model.PCFogCheck e) { return(sqlmapper.QueryForObject <bool>("PCFogCheck.has_rows_before", e)); }
public Model.PCFogCheck GetNext(Model.PCFogCheck e) { return(sqlmapper.QueryForObject <Model.PCFogCheck>("PCFogCheck.get_next", e)); }
public Model.PCFogCheck GetDetail(string PCFogCheckId) { Model.PCFogCheck p = accessor.Get(PCFogCheckId); p.Details = new BL.PCFogCheckDetailManager().Select(PCFogCheckId); return(p); }