Beispiel #1
0
        protected override void AddNew()
        {
            if (this.tag == 1)
            {
                this.tag = 0;
                return;
            }
            this._PCInputCheck = new Book.Model.PCInputCheck();
            this._PCInputCheck.PCInputCheckId   = this.manager.GetId();
            this._PCInputCheck.PCInputCheckDate = DateTime.Now;
            this._PCInputCheck.CheckEmployee    = BL.V.ActiveOperator.Employee;

            this._PCInputCheck.Heidian  = "-1";
            this._PCInputCheck.Guohuo   = "-1";
            this._PCInputCheck.Liaodian = "-1";
            this._PCInputCheck.Wasiqi   = "-1";
            this._PCInputCheck.Zazhi    = "-1";
            this._PCInputCheck.Qipao    = "-1";

            this._PCInputCheck.Duise       = "-1";
            this._PCInputCheck.Chongji     = "-1";
            this._PCInputCheck.Nairanceshi = "-1";
            this._PCInputCheck.UVvalue     = "-1";
            this._PCInputCheck.Wudu        = "";

            this.action = "insert";
        }
Beispiel #2
0
        public void UpdateIsClosed(Model.PCInputCheck model)
        {
            Hashtable ht = new Hashtable();

            ht.Add("PCInputCheckId", model.PCInputCheckId);
            ht.Add("IsClosed", model.IsClosed);
            sqlmapper.Update("PCInputCheck.UpdateIsClosed", ht);
        }
Beispiel #3
0
 protected override void MoveLast()
 {
     if (LastFlag == 1)
     {
         LastFlag = 0; return;
     }
     this._PCInputCheck = this.manager.GetLast();
 }
Beispiel #4
0
 protected override void MoveNext()
 {
     Model.PCInputCheck p = this.manager.GetNext(this._PCInputCheck);
     if (p == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._PCInputCheck = p;
 }
Beispiel #5
0
 public EditForm(string PCInputCheckId)
     : this()
 {
     this._PCInputCheck = this.manager.Get(PCInputCheckId);
     this.action        = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Beispiel #6
0
        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm f = new ListForm();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                this._PCInputCheck = f.SelectItem;
                this.action        = "view";
                this.Refresh();
            }
        }
Beispiel #7
0
        public void Validate(Model.PCInputCheck model)
        {
            if (model.PCInputCheckDate == null)
            {
                throw new Helper.InvalidValueException(Model.PCInputCheck.PRO_PCInputCheckDate);
            }

            if (string.IsNullOrEmpty(model.LotNumber))
            {
                throw new Helper.MessageValueException("批號不能為空");
            }
        }
Beispiel #8
0
 public EditForm(Model.PCInputCheck model, string action)
     : this()
 {
     if (model == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this._PCInputCheck = model;
     this.action        = action;
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Beispiel #9
0
 private void btn_OK_Click(object sender, EventArgs e)
 {
     this.DialogResult = DialogResult.OK;
     if (tag == 2)
     {
         if ((this.bindingSource1.DataSource as List <Model.PCInputCheck>) != null)
         {
             this.keys = (this.bindingSource1.DataSource as List <Model.PCInputCheck>).Where(d => d.IsCheck == true).ToList();
         }
     }
     else
     {
         this.SelectItem = this.bindingSource1.Current as Model.PCInputCheck;
     }
 }
Beispiel #10
0
 private void TiGuiExists(Model.PCInputCheck model)
 {
     if (this.ExistsPrimary(model.PCInputCheckId))
     {
         //设置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.PCInputCheckId = this.GetId(model.InsertTime.Value);
         TiGuiExists(model);
     }
 }
Beispiel #11
0
 protected override void Delete()
 {
     if (this._PCInputCheck == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
     {
         Model.PCInputCheck model = this.manager.GetNext(this._PCInputCheck);
         this.manager.Delete(this._PCInputCheck.PCInputCheckId);
         if (model == null)
         {
             this._PCInputCheck = this.manager.GetLast();
         }
         else
         {
             this._PCInputCheck = model;
         }
     }
 }
Beispiel #12
0
 private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e)
 {
     Model.PCInputCheck model = this.bindingSource1.Current as Model.PCInputCheck;
     if (model == null)
     {
         return;
     }
     if (model.IsClosed == null || model.IsClosed == false)
     {
         if (MessageBox.Show("是否強制結案?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
         {
             return;
         }
     }
     if (model.IsClosed != null && model.IsClosed.Value)
     {
         if (MessageBox.Show("是否取消結案?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
         {
             return;
         }
     }
     model.IsClosed = (model.IsClosed == null || model.IsClosed == false) ? true : false;
     try
     {
         BL.V.BeginTransaction();
         this.pCInputCheckManager.UpdateIsClosed(model);
         BL.V.CommitTransaction();
         MessageBox.Show("操作成功", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         BL.V.RollbackTransaction();
         model.IsClosed = (model.IsClosed == null || model.IsClosed == false) ? true : false;
         throw ex;
     }
     this.bindingSource1.Position = (this.bindingSource1.Position - 1) < 0 ? 0 : (this.bindingSource1.Position - 1);
     this.bindingSource1.Position = (this.bindingSource1.Position + 1) > this.bindingSource1.Count - 1 ? this.bindingSource1.Count - 1 : (this.bindingSource1.Position + 1);
 }
Beispiel #13
0
 public bool HasRowsBefore(Model.PCInputCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCInputCheck.has_rows_before", e));
 }
Beispiel #14
0
        public override void Refresh()
        {
            if (this._PCInputCheck == null)
            {
                this.AddNew();
            }
            else
            {
                if (this.action == "view" || this.action == "update")   //打印的时候会更改_PCInputCheck(黑点/过火/料点/...)的值,修改时重新刷新
                {
                    this._PCInputCheck = this.manager.Get(this._PCInputCheck.PCInputCheckId);
                }
            }

            this.txt_PCInputCheckId.EditValue    = this._PCInputCheck.PCInputCheckId;
            this.date_PCInputCheckDate.EditValue = this._PCInputCheck.PCInputCheckDate;
            this.nccSupplier.EditValue           = this._PCInputCheck.Supplier;
            this.nccMadeEmp.EditValue            = this._PCInputCheck.CheckEmployee;
            this.btn_Product.EditValue           = this._PCInputCheck.Product;
            this.txt_TestProduct.EditValue       = this._PCInputCheck.TestProductId;
            this.date_Chouliao.EditValue         = this._PCInputCheck.ChouliaoDate;
            this.date_Test.EditValue             = this._PCInputCheck.TestDate;
            this.spe_Quantity.EditValue          = this._PCInputCheck.Quantity;
            this.cobUnit.EditValue         = this._PCInputCheck.ProductUnit;
            this.nccTestEmployee.EditValue = this._PCInputCheck.TestEmployee;
            this.txt_LotNumber.EditValue   = this._PCInputCheck.LotNumber;

            this.rdo_Heidian.EditValue  = string.IsNullOrEmpty(this._PCInputCheck.Heidian) ? "0" : this._PCInputCheck.Heidian;
            this.rdo_Guohuo.EditValue   = string.IsNullOrEmpty(this._PCInputCheck.Guohuo) ? "0" : this._PCInputCheck.Guohuo;
            this.rdo_Liaodian.EditValue = string.IsNullOrEmpty(this._PCInputCheck.Liaodian) ? "0" : this._PCInputCheck.Liaodian;
            this.rdo_Wasiqi.EditValue   = string.IsNullOrEmpty(this._PCInputCheck.Wasiqi) ? "0" : this._PCInputCheck.Wasiqi;
            this.rdo_Zazhi.EditValue    = string.IsNullOrEmpty(this._PCInputCheck.Zazhi) ? "0" : this._PCInputCheck.Zazhi;
            this.rdo_Qipao.EditValue    = string.IsNullOrEmpty(this._PCInputCheck.Qipao) ? "0" : this._PCInputCheck.Qipao;
            this.rdo_Duise.EditValue    = string.IsNullOrEmpty(this._PCInputCheck.Duise) ? "0" : this._PCInputCheck.Duise;
            this.rdo_Chongji.EditValue  = string.IsNullOrEmpty(this._PCInputCheck.Chongji) ? "0" : this._PCInputCheck.Chongji;
            this.rdo_Nairan.EditValue   = string.IsNullOrEmpty(this._PCInputCheck.Nairanceshi) ? "0" : this._PCInputCheck.Nairanceshi;
            this.rdo_UV.EditValue       = string.IsNullOrEmpty(this._PCInputCheck.UVvalue) ? "0" : this._PCInputCheck.UVvalue;
            //this.rdo_Wudu.EditValue = this._PCInputCheck.Wudu;
            this.txt_Wudu.EditValue = this._PCInputCheck.Wudu;

            this.txt_ANSICSA.EditValue = this._PCInputCheck.ANSICSAToushilv;
            this.txt_EN.EditValue      = this._PCInputCheck.ENToushilv;
            this.txt_AS.EditValue      = this._PCInputCheck.ASToushilv;
            this.txt_JIS.EditValue     = this._PCInputCheck.JISToushilv;

            this.nccDuise.EditValue    = this._PCInputCheck.DuiseEmployee;
            this.nccChongji.EditValue  = this._PCInputCheck.ChongjiEmployee;
            this.nccNairan.EditValue   = this._PCInputCheck.NairanEmployee;
            this.nccUV.EditValue       = this._PCInputCheck.UVEmployee;
            this.nccToushilv.EditValue = this._PCInputCheck.ToushiEmployee;

            this.nccConfirmor.EditValue       = this._PCInputCheck.Confirmor;
            this.txt_InvoiceXOCusId.EditValue = this._PCInputCheck.InvoiceXOCusId;

            this.spe_TestQuantity.EditValue = this._PCInputCheck.TestQuantity;

            //采购单,进库单
            string[] coid = string.IsNullOrEmpty(this._PCInputCheck.InvoiceCOId) ? null : this._PCInputCheck.InvoiceCOId.Split(',');
            string[] cgid = string.IsNullOrEmpty(this._PCInputCheck.InvoiceCGId) ? null : this._PCInputCheck.InvoiceCGId.Split(',');
            if (cgid != null)
            {
                this.btn_InvoiceCGId1.EditValue = cgid[0];
                this.btn_InvoiceCGId2.EditValue = cgid.Length > 1 ? cgid[1] : "";
                this.btn_InvoiceCGId3.EditValue = cgid.Length > 2 ? cgid[2] : "";
            }
            else
            {
                this.btn_InvoiceCGId1.EditValue = null;
                this.btn_InvoiceCGId2.EditValue = null;
                this.btn_InvoiceCGId3.EditValue = null;
            }
            if (coid != null)
            {
                this.btn_InvoiceCOId1.EditValue = coid[0];
                this.btn_InvoiceCOId2.EditValue = coid.Length > 1 ? coid[1] : "";
                this.btn_InvoiceCOId3.EditValue = coid.Length > 2 ? coid[2] : "";
            }
            else
            {
                this.btn_InvoiceCOId1.EditValue = null;
                this.btn_InvoiceCOId2.EditValue = null;
                this.btn_InvoiceCOId3.EditValue = null;
            }

            this.btn_Impact.EditValue         = this._PCInputCheck.PCImpactCheckId;
            this.btn_Fog.EditValue            = this._PCInputCheck.PCFogCheckId;
            this.btn_FlameRetardant.EditValue = this._PCInputCheck.PCFlameRetardantId;

            base.Refresh();

            switch (this.action)
            {
            case "view":
                this.btn_InvoiceCGId1.Properties.Buttons[1].Visible = false;
                this.btn_InvoiceCGId2.Properties.Buttons[1].Visible = false;
                this.btn_InvoiceCGId3.Properties.Buttons[1].Visible = false;
                this.btn_InvoiceCGId1.Properties.ReadOnly           = true;
                this.btn_InvoiceCGId2.Properties.ReadOnly           = true;
                this.btn_InvoiceCGId3.Properties.ReadOnly           = true;
                this.btn_InvoiceCOId1.Properties.ReadOnly           = true;
                this.btn_InvoiceCOId2.Properties.ReadOnly           = true;
                this.btn_InvoiceCOId3.Properties.ReadOnly           = true;
                this.btn_Product.Properties.ReadOnly = true;
                //this.btn_Impact.Properties.ReadOnly = true;
                //this.btn_Fog.Properties.ReadOnly = true;
                //this.btn_FlameRetardant.Properties.ReadOnly = true;
                break;

            default:
                this.btn_InvoiceCGId1.Properties.Buttons[1].Visible = true;
                this.btn_InvoiceCGId2.Properties.Buttons[1].Visible = true;
                this.btn_InvoiceCGId3.Properties.Buttons[1].Visible = true;
                this.btn_InvoiceCGId1.Properties.ReadOnly           = true;
                this.btn_InvoiceCGId2.Properties.ReadOnly           = true;
                this.btn_InvoiceCGId3.Properties.ReadOnly           = true;
                this.btn_InvoiceCOId1.Properties.ReadOnly           = true;
                this.btn_InvoiceCOId2.Properties.ReadOnly           = true;
                this.btn_InvoiceCOId3.Properties.ReadOnly           = true;
                this.btn_Product.Properties.ReadOnly = true;
                //this.btn_Impact.Properties.ReadOnly = true;
                //this.btn_Fog.Properties.ReadOnly = true;
                //this.btn_FlameRetardant.Properties.ReadOnly = true;
                break;
            }
            updateCaption();
        }
Beispiel #15
0
 public bool HasRowsAfter(Model.PCInputCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCInputCheck.has_rows_after", e));
 }
Beispiel #16
0
 public Model.PCInputCheck GetNext(Model.PCInputCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCInputCheck>("PCInputCheck.get_next", e));
 }
Beispiel #17
0
 protected override void MoveFirst()
 {
     this._PCInputCheck = this.manager.GetFirst();
 }
Beispiel #18
0
 public Model.PCInputCheck GetPrev(Model.PCInputCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCInputCheck>("PCInputCheck.get_prev", e));
 }
Beispiel #19
0
 public bool HasRowsBefore(Model.PCInputCheck e)
 {
     return(accessor.HasRowsBefore(e));
 }
Beispiel #20
0
 public void Update(Model.PCInputCheck e)
 {
     this.Update <Model.PCInputCheck>(e);
 }
Beispiel #21
0
 public bool HasRowsAfter(Model.PCInputCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }
Beispiel #22
0
 public Model.PCInputCheck GetPrev(Model.PCInputCheck e)
 {
     return(accessor.GetPrev(e));
 }
Beispiel #23
0
        /// <summary>
        /// Update a PCInputCheck.
        /// </summary>
        public void Update(Model.PCInputCheck pCInputCheck)
        {
            //
            // todo: add other logic here.
            //
            try
            {
                BL.V.BeginTransaction();
                this.Validate(pCInputCheck);
                if (this.ExistsLotNumberUpdate(pCInputCheck.LotNumber, pCInputCheck.PCInputCheckId, pCInputCheck.ProductId))
                {
                    throw new Helper.MessageValueException("商品:" + pCInputCheck.Product + " 已有相同批號");
                }
                pCInputCheck.UpdateTime = DateTime.Now;

                //有时保存后选择数据清空
                if (string.IsNullOrEmpty(pCInputCheck.Heidian))
                {
                    pCInputCheck.Heidian = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Guohuo))
                {
                    pCInputCheck.Guohuo = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Liaodian))
                {
                    pCInputCheck.Liaodian = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Wasiqi))
                {
                    pCInputCheck.Wasiqi = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Zazhi))
                {
                    pCInputCheck.Zazhi = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Qipao))
                {
                    pCInputCheck.Qipao = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Duise))
                {
                    pCInputCheck.Duise = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Chongji))
                {
                    pCInputCheck.Chongji = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Nairanceshi))
                {
                    pCInputCheck.Nairanceshi = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.UVvalue))
                {
                    pCInputCheck.UVvalue = "0";
                }

                accessor.Update(pCInputCheck);
                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Beispiel #24
0
 public Model.PCInputCheck GetNext(Model.PCInputCheck e)
 {
     return(accessor.GetNext(e));
 }
Beispiel #25
0
        public RO(Model.PCInputCheck PCInputCheck)
            : this()
        {
            foreach (var item in PCInputCheck.GetType().GetProperties())
            {
                if (item.Name == "Heidian" || item.Name == "Guohuo" || item.Name == "Liaodian" || item.Name == "Wasiqi" || item.Name == "Zazhi" || item.Name == "Qipao" || item.Name == "Duise" || item.Name == "Chongji" || item.Name == "Nairanceshi" || item.Name == "UVvalue")
                {
                    if (item.GetValue(PCInputCheck, null) != null)
                    {
                        switch (item.GetValue(PCInputCheck, null).ToString())
                        {
                        case "0":
                            item.SetValue(PCInputCheck, "PASS", null);
                            break;

                        case "1":
                            item.SetValue(PCInputCheck, "FALL", null);
                            break;

                        case "2":
                            item.SetValue(PCInputCheck, "無此項", null);
                            break;
                        }
                    }
                }
            }

            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblPrintDate.Text  += DateTime.Now.ToString("yyyy-MM-dd");

            this.lblPCInputCheckId.Text   = PCInputCheck.PCInputCheckId;
            this.lblPCInputCheckDate.Text = PCInputCheck.PCInputCheckDate.Value.ToString("yyyy-MM-dd");
            this.lblSupplier.Text         = PCInputCheck.Supplier == null ? null : PCInputCheck.Supplier.SupplierShortName;
            this.lblMadeEmp.Text          = PCInputCheck.CheckEmployee == null ? null : PCInputCheck.CheckEmployee.EmployeeName;
            this.lblProduct.Text          = PCInputCheck.Product == null ? null : PCInputCheck.Product.ProductName;

            string[] coid = string.IsNullOrEmpty(PCInputCheck.InvoiceCOId) ? null : PCInputCheck.InvoiceCOId.Split(',');
            string[] cgid = string.IsNullOrEmpty(PCInputCheck.InvoiceCGId) ? null : PCInputCheck.InvoiceCGId.Split(',');
            if (coid != null)
            {
                this.lblInvoiceCOId.Text = coid[0] + (string.IsNullOrEmpty(coid[1]) ? "" : "," + coid[1] + (string.IsNullOrEmpty(coid[2]) ? "" : "," + coid[2]));
            }
            if (cgid != null)
            {
                this.lblInvoiceCGId.Text = cgid[0] + (string.IsNullOrEmpty(cgid[1]) ? "" : "," + cgid[1] + (string.IsNullOrEmpty(cgid[2]) ? "" : "," + cgid[2]));
            }
            this.lblQuantity.Text     = PCInputCheck.Quantity.Value.ToString();
            this.lblProductUnit.Text  = PCInputCheck.ProductUnit;
            this.lblChouliaoDate.Text = PCInputCheck.ChouliaoDate == null ? null : PCInputCheck.ChouliaoDate.Value.ToString("yyyy-MM-dd");
            this.lblTestDate.Text     = PCInputCheck.TestDate == null ? null : PCInputCheck.TestDate.Value.ToString("yyyy-MM-dd");
            this.lblLotNukber.Text    = PCInputCheck.LotNumber;
            this.lblTestProduct.Text  = PCInputCheck.TestProductId;
            this.lblTestEmployee.Text = PCInputCheck.TestEmployee == null ? null : PCInputCheck.TestEmployee.EmployeeName;

            this.TCHeidian.Text     = PCInputCheck.Heidian;
            this.TCGuohuo.Text      = PCInputCheck.Guohuo;
            this.TCLiaodian.Text    = PCInputCheck.Liaodian;
            this.TCWasiqi.Text      = PCInputCheck.Wasiqi;
            this.TCZazhi.Text       = PCInputCheck.Zazhi;
            this.TCQipao.Text       = PCInputCheck.Qipao;
            this.TCDuise.Text       = PCInputCheck.Duise;
            this.TCChongji.Text     = PCInputCheck.Chongji;
            this.TCNairan.Text      = PCInputCheck.Nairanceshi;
            this.TCUV.Text          = PCInputCheck.UVvalue;
            this.TCANSI.Text        = PCInputCheck.ANSICSAToushilv;
            this.TCEN.Text          = PCInputCheck.ENToushilv;
            this.TCAS.Text          = PCInputCheck.ASToushilv;
            this.TCJIS.Text         = PCInputCheck.JISToushilv;
            this.TC_Wudu.Text       = PCInputCheck.Wudu;
            this.TC_GBToushilv.Text = PCInputCheck.GBToushilv;

            this.TCDuiseEmp.Text   = PCInputCheck.DuiseEmployee == null ? null : PCInputCheck.DuiseEmployee.EmployeeName;
            this.TCChongjiEmp.Text = PCInputCheck.ChongjiEmployee == null ? null : PCInputCheck.ChongjiEmployee.EmployeeName;
            this.TCNairanEmp.Text  = PCInputCheck.NairanEmployee == null ? null : PCInputCheck.NairanEmployee.EmployeeName;
            this.TCUVEmp.Text      = PCInputCheck.UVEmployee == null ? null : PCInputCheck.UVEmployee.EmployeeName;
            this.TCToushiEmp.Text  = PCInputCheck.ToushiEmployee == null ? null : PCInputCheck.ToushiEmployee.EmployeeName;

            this.lblConfirmor.Text = PCInputCheck.Confirmor == null ? null : PCInputCheck.Confirmor.EmployeeName;

            this.lblTestQuantity.Text = PCInputCheck.TestQuantity.HasValue ? PCInputCheck.TestQuantity.Value.ToString("0.##") : "";

            this.lbl_TestProductUnit.Text = PCInputCheck.TestProductUnit;
        }
Beispiel #26
0
 public void UpdateIsClosed(Model.PCInputCheck model)
 {
     accessor.UpdateIsClosed(model);
 }
Beispiel #27
0
        /// <summary>
        /// Insert a PCInputCheck.
        /// </summary>
        public void Insert(Model.PCInputCheck pCInputCheck)
        {
            //
            // todo:add other logic here
            //
            try
            {
                BL.V.BeginTransaction();
                this.Validate(pCInputCheck);

                pCInputCheck.InsertTime = DateTime.Now;
                pCInputCheck.UpdateTime = DateTime.Now;
                this.TiGuiExists(pCInputCheck);
                if (this.ExistsLotNumberInsert(pCInputCheck.LotNumber, pCInputCheck.ProductId))
                {
                    throw new Helper.MessageValueException("商品:" + pCInputCheck.Product + " 已有相同批號");
                }

                string invoiceKind   = this.GetInvoiceKind().ToLower();
                string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, pCInputCheck.InsertTime.Value.Year);
                string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, pCInputCheck.InsertTime.Value.Year, pCInputCheck.InsertTime.Value.Month);
                string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, pCInputCheck.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);

                //有时保存后选择数据清空
                if (string.IsNullOrEmpty(pCInputCheck.Heidian))
                {
                    pCInputCheck.Heidian = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Guohuo))
                {
                    pCInputCheck.Guohuo = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Liaodian))
                {
                    pCInputCheck.Liaodian = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Wasiqi))
                {
                    pCInputCheck.Wasiqi = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Zazhi))
                {
                    pCInputCheck.Zazhi = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Qipao))
                {
                    pCInputCheck.Qipao = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Duise))
                {
                    pCInputCheck.Duise = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Chongji))
                {
                    pCInputCheck.Chongji = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.Nairanceshi))
                {
                    pCInputCheck.Nairanceshi = "0";
                }
                if (string.IsNullOrEmpty(pCInputCheck.UVvalue))
                {
                    pCInputCheck.UVvalue = "0";
                }

                accessor.Insert(pCInputCheck);
                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Beispiel #28
0
 public void Insert(Model.PCInputCheck e)
 {
     this.Insert <Model.PCInputCheck>(e);
 }