Exemplo n.º 1
0
 protected override void AddNew()
 {
     this._PCOPC = new Book.Model.PCOpticsCheck();
     this._PCOPC.PCOpticsCheckId       = this._PCOCManager.GetId();
     this._PCOPC.PCOpticsCheckDate     = DateTime.Now.Date;
     this._PCOPC.PCOpticsCheckQuantity = 1;  //默认检测数量为1
 }
Exemplo n.º 2
0
        public void Insert(Model.PCOpticsCheck pCOpticsCheck)
        {
            Validate(pCOpticsCheck);
            try
            {
                BL.V.BeginTransaction();

                pCOpticsCheck.InsertTime = DateTime.Now;
                pCOpticsCheck.UpdateTime = DateTime.Now;
                TiGuiExists(pCOpticsCheck);

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

                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Exemplo n.º 3
0
 protected override void MoveLast()
 {
     if (this.LastFlag == 1)
     {
         this.LastFlag = 0;
         return;
     }
     this._PCOPC = this._PCOCManager.Get(this._PCOCManager.GetLast() == null ? "" : this._PCOCManager.GetLast().PCOpticsCheckId);
 }
Exemplo n.º 4
0
 protected override void AddNew()
 {
     this._PCOPC = new Book.Model.PCOpticsCheck();
     this._PCOPC.PCOpticsCheckId       = this._PCOCManager.GetId();
     this._PCOPC.PCOpticsCheckDate     = DateTime.Now.Date;
     this._PCOPC.PCOpticsCheckQuantity = 1;  //默认检测数量为1
     this._PCOPC.Employee   = BL.V.ActiveOperator.Employee;
     this._PCOPC.EmployeeId = BL.V.ActiveOperator.EmployeeId;
 }
Exemplo n.º 5
0
        protected override void MovePrev()
        {
            Model.PCOpticsCheck pcopc = this._PCOCManager.GetPrev(this._PCOPC);
            if (pcopc == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }

            this._PCOPC = this._PCOCManager.Get(pcopc.PCOpticsCheckId);
        }
Exemplo n.º 6
0
        public void Update(Model.PCOpticsCheck pCOpticsCheck)
        {
            if (pCOpticsCheck != null)
            {
                Validate(pCOpticsCheck);
                pCOpticsCheck.UpdateTime = DateTime.Now;

                accessor.Update(pCOpticsCheck);
            }
        }
Exemplo n.º 7
0
 public EditForm(Model.PCOpticsCheck mPCOC, string action)
     : this()
 {
     this._PCOPC = mPCOC;
     this.action = action;
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Exemplo n.º 8
0
        private void barBtn_Search_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm f = new ListForm();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                this._PCOPC = f.SelectItem as Model.PCOpticsCheck;
                this.action = "view";
                this.Refresh();
            }
            f.Dispose();
            GC.Collect();
        }
Exemplo n.º 9
0
 public EditForm(string invoiceId)
     : this()
 {
     this._PCOPC = this._PCOCManager.Get(invoiceId);
     if (this._PCOPC == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Exemplo n.º 10
0
 public EditForm(Model.PCOpticsCheck mPCOC)
     : this()
 {
     if (mPCOC == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this._PCOPC = mPCOC;
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Exemplo n.º 11
0
 protected override void Delete()
 {
     if (this._PCOPC == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this._PCOCManager.Delete(this._PCOPC.PCOpticsCheckId);
     this._PCOPC = this._PCOCManager.GetNext(this._PCOPC);
     if (this._PCOPC == null)
     {
         this._PCOPC = this._PCOCManager.GetLast();
     }
 }
Exemplo n.º 12
0
 private void TiGuiExists(Model.PCOpticsCheck model)
 {
     if (this.ExistsPrimary(model.PCOpticsCheckId))
     {
         //设置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.PCOpticsCheckId = this.GetId(model.InsertTime.Value);
         TiGuiExists(model);
     }
 }
Exemplo n.º 13
0
 private void Validate(Model.PCOpticsCheck mPCOptics)
 {
     if (string.IsNullOrEmpty(mPCOptics.PCOpticsCheckId))
     {
         throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_PCOpticsCheckId);
     }
     if (string.IsNullOrEmpty(mPCOptics.ProductId))
     {
         throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_ProductId);
     }
     if (string.IsNullOrEmpty(mPCOptics.PCOpticsCheckDate.ToString()))
     {
         throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_PCOpticsCheckDate);
     }
     if (string.IsNullOrEmpty(mPCOptics.EmployeeId))
     {
         throw new Helper.RequireValueException(Model.PCOpticsCheck.PRO_EmployeeId);
     }
 }
Exemplo n.º 14
0
        public override void Refresh()
        {
            if (this._PCOPC == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this._PCOPC = this._PCOCManager.Get(this._PCOPC.PCOpticsCheckId);
                }
            }

            this.txtPCOpticsCheckId.Text            = this._PCOPC.PCOpticsCheckId;
            this.txtInvoiceCusXOId.Text             = this._PCOPC.InvoiceCusXOId;
            this.txtPCOpticsCheckDesc.Text          = this._PCOPC.PCOpticsCheckDesc;
            this.DE_JYDRQ.EditValue                 = this._PCOPC.PCOpticsCheckDate;
            this.txtProduct.Text                    = this._PCOPC.Product == null ? "" : this._PCOPC.Product.ToString();
            this.CE_PCOpticsCheckQuantity.EditValue = this._PCOPC.PCOpticsCheckQuantity.HasValue ? this._PCOPC.PCOpticsCheckQuantity.Value : 0;
            this.CE_InvoiceXOQuantity.EditValue     = this._PCOPC.InvoiceXOQuantity.HasValue ? this._PCOPC.InvoiceXOQuantity.Value : 0;
            this.txtPronoteHeaderId.Text            = this._PCOPC.PronoteHeaderId;
            this.nccEmployee0.EditValue             = this._PCOPC.Employee;
            this.chkZiWaiXian.Checked               = this._PCOPC.IsZiWaiXian.HasValue ? this._PCOPC.IsZiWaiXian.Value : false;
            this.chkKeJianGuang.Checked             = this._PCOPC.IsKeJianGuang.HasValue ? this._PCOPC.IsKeJianGuang.Value : false;

            this.newChooseContorlAuditEmp.EditValue = this._PCOPC.AuditEmp;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._PCOPC.AuditState);
            this.lookUpEditUnit.EditValue           = this._PCOPC.ProductUnitId;

            base.Refresh();

            this.CE_InvoiceXOQuantity.Enabled           = false;
            this.txtPCOpticsCheckId.Properties.ReadOnly = true;
        }
Exemplo n.º 15
0
 public void Update(Model.PCOpticsCheck e)
 {
     this.Update <Model.PCOpticsCheck>(e);
 }
Exemplo n.º 16
0
 public bool HasRowsBefore(Model.PCOpticsCheck e)
 {
     return(accessor.HasRowsBefore(e));
 }
Exemplo n.º 17
0
 public bool HasRowsBefore(Model.PCOpticsCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCOpticsCheck.has_rows_before", e));
 }
Exemplo n.º 18
0
 public bool HasRowsAfter(Model.PCOpticsCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }
Exemplo n.º 19
0
 public Model.PCOpticsCheck GetPrev(Model.PCOpticsCheck e)
 {
     return(accessor.GetPrev(e));
 }
Exemplo n.º 20
0
 public Model.PCOpticsCheck GetNext(Model.PCOpticsCheck e)
 {
     return(accessor.GetNext(e));
 }
Exemplo n.º 21
0
        public RO(Model.PCOpticsCheck _pcopc)
        {
            InitializeComponent();
            if (_pcopc == null)
            {
                return;
            }
            //CompanyInfo
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblDataName.Text    = Properties.Resources.PCOpticsCheck;
            //this.lblPrintDate.Text += DateTime.Now.ToShortDateString();

            //Details Controls
            this.lblPCOpticsCheckId.Text       = _pcopc.PCOpticsCheckId;
            this.lblPCOpticsCheckDate.Text     = _pcopc.PCOpticsCheckDate.HasValue ? _pcopc.PCOpticsCheckDate.Value.ToString("yyyy-MM-dd") : "";
            this.lblPronoteHeardId.Text        = _pcopc.PronoteHeaderId;
            this.lblProductName.Text           = _pcopc.Product == null ? "" : _pcopc.Product.ToString();
            this.lblInvoiceCusXOId.Text        = _pcopc.InvoiceCusXOId;
            this.lblInvoiceXOQuantity.Text     = _pcopc.InvoiceXOQuantity.HasValue ? _pcopc.InvoiceXOQuantity.Value.ToString() : "0";
            this.lblPCOpticsCheckQuantity.Text = _pcopc.PCOpticsCheckQuantity.HasValue ? _pcopc.PCOpticsCheckQuantity.Value.ToString() : "0";
            this.chkZiWaiXian.Checked          = _pcopc.IsZiWaiXian.HasValue ? _pcopc.IsZiWaiXian.Value : false;
            this.chkKeJianGuang.Checked        = _pcopc.IsKeJianGuang.HasValue ? _pcopc.IsKeJianGuang.Value : false;
            this.lblPCOpticsCheckDesc.Text     = _pcopc.PCOpticsCheckDesc;
            this.lblEmployee.Text     = _pcopc.Employee.ToString();
            this.lbl_ProductUnit.Text = _pcopc.ProductUnit == null ? "" : _pcopc.ProductUnit.ToString();
            //this.lblPCOpticsCheckId.Text = _pcfc.PCFinishCheckID;
            //this.lblPCOpticsCheckDate.Text = _pcfc.PCFinishCheckDate.HasValue ? _pcfc.PCFinishCheckDate.Value.ToShortDateString() : "";
            //this.lblProductName.Text = _pcfc.Product == null ? "" : _pcfc.Product.ToString();
            //this.lblBuMen.Text = _pcfc.WorkHouse == null ? "" : _pcfc.WorkHouse.ToString();
            //this.lblInvoiceCusXOId.Text = _pcfc.InvoiceCusXOId;
            //this.lblPCFinishCheckCount.Text = _pcfc.PCFinishCheckCount.ToString();
            //this.lblPCFinishCheckInCoiunt.Text = _pcfc.PCFinishCheckInCoiunt.HasValue ? _pcfc.PCFinishCheckInCoiunt.Value.ToString() : "";
            //this.lblPCFinishCheckDesc.Text = _pcfc.PCFinishCheckDesc;
            //this.lblEmployee0.Text = _pcfc.Employee0 == null ? "" : _pcfc.Employee0.ToString();
            //this.lblEmployee1.Text = _pcfc.Employee1 == null ? "" : _pcfc.Employee1.ToString();
            //this.lblCustomerProductName.Text = _pcfc.Product.CustomerProductName;
            //this.lblPronoteHeardId.Text = _pcfc.PronoteHeaderID;
            //this.lblCustomerProductName.Text = _pcfc.CustomerProductName;

            //details
            //this.lblDZDWQDW.Text = Trans(_pcfc.AttrDZDWQDW);
            //this.lblJWYHWRL.Text = Trans(_pcfc.AttrJWYHWRL);
            //this.lblGZBKYRL.Text = Trans(_pcfc.AttrGZBKYRL);
            //this.lblZZWBXGJ.Text = Trans(_pcfc.AttrZZWBXGJ);
            //this.lblJPBKGCS.Text = Trans(_pcfc.AttrJPBKGS);
            //this.lblJPJJHZQ.Text = Trans(_pcfc.AttrJPJHZQ);
            //this.lblJPJSX.Text = Trans(_pcfc.AttrJPSX);
            //this.lblJJSFTSYH.Text = Trans(_pcfc.AttrJJSFTSYH);
            //this.lblGX.Text = Trans(_pcfc.AttrGX);
            //this.lblTSL.Text = Trans(_pcfc.AttrTSL);
            //this.lblCJBZ.Text = Trans(_pcfc.AttrCJBZ);
            //this.lblWXTB.Text = Trans(_pcfc.AttrWXTB);
            //this.lblZMCM.Text = Trans(_pcfc.AttrZMCM);
            //this.lblSLDKSFMF.Text = Trans(_pcfc.AttrSLDSFMF);
            //this.lblNHDQSFZQ.Text = Trans(_pcfc.AttrNHDQSFZQ);
            //this.lblNHTB.Text = Trans(_pcfc.AttrNHTB);
            //this.lblJSSFZQ.Text = Trans(_pcfc.AttrJSSFZQ);
            //this.lblJDZRFS.Text = Trans(_pcfc.AttrJDZRFS);
            //this.lblPKZRFS.Text = Trans(_pcfc.AttrPKZRFS);
            //this.lblSLDNHWXTMTBSFZQ.Text = Trans(_pcfc.AttrSLDNHWXTMSFZQ);
        }
Exemplo n.º 22
0
 public Model.PCOpticsCheck GetNext(Model.PCOpticsCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCOpticsCheck>("PCOpticsCheck.get_next", e));
 }
Exemplo n.º 23
0
 public bool HasRowsAfter(Model.PCOpticsCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCOpticsCheck.has_rows_after", e));
 }
Exemplo n.º 24
0
 public Model.PCOpticsCheck GetPrev(Model.PCOpticsCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCOpticsCheck>("PCOpticsCheck.get_prev", e));
 }
Exemplo n.º 25
0
 protected override void MoveFirst()
 {
     this._PCOPC = this._PCOCManager.Get(this._PCOCManager.GetFirst() == null ? "" : this._PCOCManager.GetFirst().PCOpticsCheckId);
 }
Exemplo n.º 26
0
 public void Insert(Model.PCOpticsCheck e)
 {
     this.Insert <Model.PCOpticsCheck>(e);
 }