protected override void AddNew() { this._pcdic = new Book.Model.PCDoubleImpactCheck(); this._pcdic.PCDoubleImpactCheckID = this._pcdicManage.GetId(); this._pcdic.PCDoubleImpactCheckDate = DateTime.Now.Date; this._pcdic.PCDoubleImpactCheckType = 0; this._pcdic.PCDoubleImpactCheckCount = 1; //默认抽检数量为1 //this._pcdic.Employee = BL.V.ActiveOperator.Employee; //初始化一条详细 this._pcdic.Detail = new List <Model.PCDoubleImpactCheckDetail>(); this.AddDataRows(); }
protected override void AddNew() { this._pcdic = new Book.Model.PCDoubleImpactCheck(); this._pcdic.PCDoubleImpactCheckID = this._pcdicManage.GetId(); this._pcdic.PCDoubleImpactCheckDate = DateTime.Now.Date; this._pcdic.PCDoubleImpactCheckType = 0; this._pcdic.PCDoubleImpactCheckCount = 6; //默认抽检数量为1 this._pcdic.ProductUnitId = "f7f95879-3444-494b-92eb-2aa784c52e8c"; //this._pcdic.Employee = BL.V.ActiveOperator.Employee; //初始化一条详细 this._pcdic.Detail = new List <Model.PCDoubleImpactCheckDetail>(); this.AddDataRows(); }
public EditForm(Model.PCDoubleImpactCheck mpcdic) : this() { if (mpcdic == null) { throw new ArithmeticException("invoiceid"); } this._pcdic = mpcdic; this.action = "view"; if (this.action == "view") { LastFlag = 1; } }
/// <summary> /// Insert a PCDoubleImpactCheck. /// </summary> public void Insert(Model.PCDoubleImpactCheck pCDoubleImpactCheck) { Validate(pCDoubleImpactCheck); if (this.IsExistsPNTForInsert(pCDoubleImpactCheck.PronoteHeaderId, pCDoubleImpactCheck.PCDoubleImpactCheckType)) { throw new Helper.MessageValueException("此加工單已生成對應的測試單,請勿重複生成!"); } try { BL.V.BeginTransaction(); pCDoubleImpactCheck.InsertTime = DateTime.Now; pCDoubleImpactCheck.UpdateTime = DateTime.Now; TiGuiExists(pCDoubleImpactCheck); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, pCDoubleImpactCheck.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, pCDoubleImpactCheck.InsertTime.Value.Year, pCDoubleImpactCheck.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, pCDoubleImpactCheck.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(pCDoubleImpactCheck); foreach (Model.PCDoubleImpactCheckDetail detail in pCDoubleImpactCheck.Detail) { detail.PCDoubleImpactCheckID = pCDoubleImpactCheck.PCDoubleImpactCheckID; PCDICDAccessor.Insert(detail); } BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
/// <summary> /// Update a PCDoubleImpactCheck. /// </summary> public void Update(Model.PCDoubleImpactCheck pCDoubleImpactCheck) { if (pCDoubleImpactCheck != null) { if (this.IsExistsPNTForUpdate(pCDoubleImpactCheck.PronoteHeaderId, pCDoubleImpactCheck.PCDoubleImpactCheckType, pCDoubleImpactCheck.PCDoubleImpactCheckID)) { throw new Helper.MessageValueException("此加工單已生成對應的測試單,請勿重複生成!"); } Validate(pCDoubleImpactCheck); //修改头信息 pCDoubleImpactCheck.UpdateTime = DateTime.Now; accessor.Update(pCDoubleImpactCheck); //删除详细 PCDICDAccessor.DeleteByPCDoubleImpactCheckId(pCDoubleImpactCheck.PCDoubleImpactCheckID); //添加详细 foreach (Model.PCDoubleImpactCheckDetail detail in pCDoubleImpactCheck.Detail) { detail.PCDoubleImpactCheckID = pCDoubleImpactCheck.PCDoubleImpactCheckID; PCDICDAccessor.Insert(detail); } } }
protected override void AddNew() { this._pcdic = new Book.Model.PCDoubleImpactCheck(); this._pcdic.PCDoubleImpactCheckID = this._pcdicManage.GetId(); this._pcdic.PCDoubleImpactCheckDate = DateTime.Now.Date; this._pcdic.PCDoubleImpactCheckType = 0; this._pcdic.PCDoubleImpactCheckCount = 1; //默认抽检数量为1 this._pcdic.Employee = BL.V.ActiveOperator.Employee; this._pcdic.EmployeeId = BL.V.ActiveOperator.EmployeeId; if (this.pcType == 0) { if (this.CJLD.Any(d => d.SettingCurrentValue.Contains("154 FT/S"))) { this.coBoxCJLD.EditValue = this.CJLD.First(d => d.SettingCurrentValue.Contains("154 FT/S")).SettingCurrentValue; } } else if (this.pcType == 1) { if (this.CJLD.Any(d => d.SettingCurrentValue.Contains("152.5 FT/S"))) { this.coBoxCJLD.EditValue = this.CJLD.First(d => d.SettingCurrentValue.Contains("152.5 FT/S")).SettingCurrentValue; } } else { if (this.CJLD.Any(d => d.SettingCurrentValue.Contains("137 FT/S"))) { this.coBoxCJLD.EditValue = this.CJLD.First(d => d.SettingCurrentValue.Contains("137 FT/S")).SettingCurrentValue; } } //初始化一条详细 this._pcdic.Detail = new List <Model.PCDoubleImpactCheckDetail>(); this.AddDataRows(); }
public RO(Model.PCDoubleImpactCheck _pcdic) { InitializeComponent(); if (_pcdic == null) { return; } details = pcdicdManager.SelectByPCDoubleICId(_pcdic.PCDoubleImpactCheckID); this.DataSource = details.OrderBy(d => d.PCDoubleImpactCheckDetailDate).ToList(); //this.DataSource = _pcdic.Detail; //CompanyInfo this.lblCompanyName.Text = BL.Settings.CompanyChineseName; switch (_pcdic.PCDoubleImpactCheckType) { case 0: this.lblDataName.Text = Properties.Resources.CSAcjcsd; //this.xtcHengWen.Visible = false; //this.xtcJiaRe.Visible = false; //this.TCattrHotL.Visible = false; //this.TCattrHotR.Visible = false; //this.TCattrCoolL.Visible = false; //this.TCattrCoolR.Visible = false; break; case 1: this.lblDataName.Text = Properties.Resources.BSENcjcsd; //this.xtcJIaoLian.Visible = false; //this.TCattrJiaoLianL.Visible = false; //this.TCattrJiaoLianR.Visible = false; break; case 2: this.lblDataName.Text = Properties.Resources.ASNZScjcsd; //this.xtcJIaoLian.Visible = false; //this.TCattrJiaoLianL.Visible = false; //this.TCattrJiaoLianR.Visible = false; //this.xtcHengWen.Visible = false; //this.xtcJiaRe.Visible = false; //this.TCattrHotL.Visible = false; //this.TCattrHotR.Visible = false; //this.TCattrCoolL.Visible = false; //this.TCattrCoolR.Visible = false; break; default: break; } //this.lblPriteDate.Text += DateTime.Now.ToShortDateString(); //Control this.lblANSIPCImpactCheckID.Text = _pcdic.PCDoubleImpactCheckID; this.lblANSIPCImpactCheckDate.Text = _pcdic.PCDoubleImpactCheckDate.HasValue ? _pcdic.PCDoubleImpactCheckDate.Value.ToShortDateString() : ""; this.lblInvoiceCusXOId.Text = _pcdic.InvoiceCusXOId; this.lblPronoteHeaderId.Text = _pcdic.PronoteHeaderId; this.lblProduct.Text = _pcdic.Product == null ? "" : _pcdic.Product.ToString(); this.lblEmployee0.Text = _pcdic.Employee == null ? "" : _pcdic.Employee.ToString(); this.RTDescript.Text = _pcdic.PCDoubleImpactCheckDesc; this.lblCheckStandard.Text = _pcdic.CheckStandard; this.lblChongJiLiDu.Text = _pcdic.PowerImpact; this.lblInvoiceXOQuantity.Text = _pcdic.InvoiceXOQuantity.HasValue ? _pcdic.InvoiceXOQuantity.ToString() : ""; this.lblPCDoubleImpactCheckCount.Text = _pcdic.PCDoubleImpactCheckCount.HasValue ? _pcdic.PCDoubleImpactCheckCount.ToString() : ""; this.lbl_productunit.Text = _pcdic.ProductUnit == null ? "" : _pcdic.ProductUnit.ToString(); //this.lbl_CustomerProductName.Text = _pcdic.Product == null ? "" : _pcdic.Product.CustomerProductName; if (_pcdic.Product != null) { if (string.IsNullOrEmpty(_pcdic.Product.CustomerProductName)) { this.lbl_CustomerProductName.Text = CommonHelp.GetCustomerProductNameByPronoteHeaderId(_pcdic.PronoteHeaderId, _pcdic.ProductId); } else { this.lbl_CustomerProductName.Text = _pcdic.Product.CustomerProductName; } } //Details #region ¸ü¸ÄÏêϸÏÔʾ foreach (Model.PCDoubleImpactCheckDetail detail in details) { foreach (var a in detail.GetType().GetProperties()) { if (a.Name.IndexOf("attr") > -1) { if (a.GetValue(detail, null) != null) { switch (a.GetValue(detail, null).ToString()) { case "0": a.SetValue(detail, "¡Ì", null); break; case "1": a.SetValue(detail, "¡÷", null); break; case "2": a.SetValue(detail, "X", null); break; default: break; } } } } } #endregion this.TCPCDoubleImpactCheckDetailDate.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_PCDoubleImpactCheckDetailDate, "{0:yyyy-MM-dd HH:mm:ss}"); // this.TCattrJiaoLianL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJiaoLianL); // this.TCattrJiaoLianR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJiaoLianR); this.TCattrJPUpL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPUpL); this.TCattrJPUpR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPUpR); this.TCattrJPDownL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPDownL); this.TCattrJPDownR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPDownR); this.TCattrJPLeftL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPLeftL); this.TCattrJPLeftR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPLeftR); this.TCattrJPRightL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPRightL); this.TCattrJPRightR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPRightR); this.TCattrBiZhong.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrBiZhong); this.TCattrShangLiangL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrShangLiangL); this.TCattrShangLiangR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrShangLiangR); this.TCattrJPZYL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPZYL); this.TCattrJPZYR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrJPZYR); this.TCattrS_SZhongL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SZhongL); this.TCattrS_SZhongR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SZhongR); this.TCattrS_SShangL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SShangL); this.TCattrS_SShangR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SShangR); this.TCattrS_SXiaL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SXiaL); this.TCattrS_SXiaR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrS_SXiaR); //this.TCattrHotL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHotL); //this.TCattrHotR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHotR); //this.TCattrCoolL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolL); //this.TCattrCoolR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolR); this.TCEmployee.DataBindings.Add("Text", this.DataSource, "Employee." + Model.Employee.PROPERTY_EMPLOYEENAME); //this.lblattrHeat60.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHeat60); //this.lblattrHeat30m.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHeat30m); this.xrBanBie.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_PCDoubleImpactCheckBanBie); this.lblHML.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHM500gL); this.lblHMR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrHM500gR); this.lblZhuiqiuL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrZhuiQiu68gL); this.lblZhuiqiuR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrZhuiQiu68gR); this.lblChuantouL.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrChuanTou44_2gL); this.lblChuantouR.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrChuanTou44_2gR); //this.lblCool1.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolL); //this.lblCool2.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolR); this.lbl_Test1.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolL); this.lbl_Test2.DataBindings.Add("Text", this.DataSource, Model.PCDoubleImpactCheckDetail.PRO_attrCoolR); }
public Model.PCDoubleImpactCheck GetNext(Model.PCDoubleImpactCheck e) { return(accessor.GetNext(e)); }
public bool HasRowsAfter(Model.PCDoubleImpactCheck e) { return(accessor.HasRowsAfter(e)); }
public bool HasRowsBefore(Model.PCDoubleImpactCheck e) { return(accessor.HasRowsBefore(e)); }
public Model.PCDoubleImpactCheck GetPrev(Model.PCDoubleImpactCheck e) { return(sqlmapper.QueryForObject <Model.PCDoubleImpactCheck>("PCDoubleImpactCheck.get_prev", e)); }
public Model.PCDoubleImpactCheck GetNext(Model.PCDoubleImpactCheck e) { return(sqlmapper.QueryForObject <Model.PCDoubleImpactCheck>("PCDoubleImpactCheck.get_next", e)); }
public bool HasRowsAfter(Model.PCDoubleImpactCheck e) { return(sqlmapper.QueryForObject <bool>("PCDoubleImpactCheck.has_rows_after", e)); }
public bool HasRowsBefore(Model.PCDoubleImpactCheck e) { return(sqlmapper.QueryForObject <bool>("PCDoubleImpactCheck.has_rows_before", e)); }
public void Update(Model.PCDoubleImpactCheck e) { this.Update <Model.PCDoubleImpactCheck>(e); }