Ejemplo n.º 1
0
        /// <summary>
        /// Update a PCClarityCheck.
        /// </summary>
        public void Update(Model.PCClarityCheck pCClarityCheck)
        {
            //
            // todo: add other logic here.
            //
            Validate(pCClarityCheck);
            try
            {
                BL.V.BeginTransaction();
                pCClarityCheck.UpdateTime = DateTime.Now;
                accessor.Update(pCClarityCheck);

                this.detailManager.DeleteByPCClarityCheckID(pCClarityCheck.PCClarityCheckId);
                foreach (Model.PCClarityCheckDetail model in pCClarityCheck.Details)
                {
                    detailManager.Insert(model);
                }
                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Ejemplo n.º 2
0
 public void Delete(Model.PCClarityCheck PCClarityCheck)
 {
     if (PCClarityCheck != null)
     {
         this.Delete(PCClarityCheck.PCClarityCheckId);
     }
 }
Ejemplo n.º 3
0
 protected override void MoveLast()
 {
     if (LastFlag == 1)
     {
         LastFlag = 0; return;
     }
     this._pcClarity = this._pcClarityManager.GetLast();
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 查询该单据及其详细
 /// </summary>
 /// <param name="pCClarityCheck"></param>
 /// <returns></returns>
 public Book.Model.PCClarityCheck Get(Book.Model.PCClarityCheck pCClarityCheck)
 {
     Model.PCClarityCheck model = this.Get(pCClarityCheck.PCClarityCheckId);
     if (model != null)
     {
         model.Details = new BL.PCClarityCheckDetailManager().SelectByPCClarityCheckId(pCClarityCheck.PCClarityCheckId);
     }
     return(model);
 }
Ejemplo n.º 5
0
 protected override void MoveNext()
 {
     Model.PCClarityCheck model = this._pcClarityManager.GetNext(this._pcClarity);
     if (model == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._pcClarity = model;
 }
Ejemplo n.º 6
0
 public EditForm(Model.PCClarityCheck PCClarityCheck, string action)
     : this()
 {
     this._pcClarity = PCClarityCheck;
     this.action     = action;
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Ejemplo n.º 7
0
 private void Validate(Model.PCClarityCheck pCClarityCheck)
 {
     if (pCClarityCheck.ProductId == null)
     {
         throw new Helper.RequireValueException(Model.PCClarityCheck.PRO_ProductId);
     }
     if (pCClarityCheck.EmployeeId == null)
     {
         throw new Helper.RequireValueException(Model.PCClarityCheck.PRO_EmployeeId);
     }
 }
Ejemplo n.º 8
0
        public override void Refresh()
        {
            if (this._pcClarity == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcClarity = this._pcClarityManager.Get(this._pcClarity);
                }
            }

            //初始化控件
            this.txt_PCClarityCheckId.Text     = this._pcClarity.PCClarityCheckId;
            this.txtPronoteHeaderId.Text       = this._pcClarity.PronoteHeaderId;
            this.txtInvoiceCusXOId.Text        = this._pcClarity.InvoiceCusXOId;
            this.ceInvoiceXOCount.EditValue    = this._pcClarity.InvoiceXOQuantity.HasValue ? this._pcClarity.InvoiceXOQuantity.Value : 0;
            this.calcPCCheckCount.EditValue    = this._pcClarity.CheckCount.HasValue ? this._pcClarity.CheckCount.Value : 0;
            this.Date_PCClarityCheck.EditValue = this._pcClarity.CheckDate.Value;
            this.BEProduct.EditValue           = this._pcClarity.Product;
            this.nccEmployee0.EditValue        = this._pcClarity.Employee;
            this.txtCheckedStadard.Text        = this._pcClarity.CheckStadard;

            this.newChooseContorlAuditEmp.EditValue = this._pcClarity.AuditEmp;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._pcClarity.AuditState);
            this.lookUpEditUnit.EditValue           = this._pcClarity.ProductUnitId;
            this.richTextBoxNote.Rtf = this._pcClarity.Note;

            this.bindingSourceDetail.DataSource = this._pcClarity.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.ceInvoiceXOCount.Enabled = false;
            this.txt_PCClarityCheckId.Properties.ReadOnly = true;
            this.BEProduct.Properties.ReadOnly            = true;
        }
Ejemplo n.º 9
0
        private void repositoryItemHyperLinkEdit1_Click(object sender, EventArgs e)
        {
            if (bindingSource1.Current != null)
            {
                DataRowView dr = bindingSource1.Current as DataRowView;
                if (dr != null)
                {
                    PCClarityCheck = pCClarityCheckManager.GetDetail(dr["PCClarityCheckId"].ToString());

                    this.DialogResult = DialogResult.OK;
                }
            }
        }
Ejemplo n.º 10
0
 public EditForm(Model.PCClarityCheck PCClarityCheck)
     : this()
 {
     if (PCClarityCheck == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this._pcClarity = PCClarityCheck;
     this.action     = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Ejemplo n.º 11
0
 protected override void AddNew()
 {
     this._pcClarity = new Book.Model.PCClarityCheck();
     this._pcClarity.PCClarityCheckId = this._pcClarityManager.GetId();
     this._pcClarityManager.TiGuiExists(this._pcClarity);
     this._pcClarity.CheckDate     = DateTime.Now.Date;
     this._pcClarity.CheckCount    = 6; //检测数量默认为6
     this._pcClarity.ProductUnitId = "f7f95879-3444-494b-92eb-2aa784c52e8c";
     this._pcClarity.Employee      = BL.V.ActiveOperator.Employee;
     this._pcClarity.EmployeeId    = BL.V.ActiveOperator.EmployeeId;
     //初始化添加一条详细
     this._pcClarity.Details = new List <Model.PCClarityCheckDetail>();
     this.AddDataRows();
 }
Ejemplo n.º 12
0
        //搜索
        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm form = new ListForm();

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                Model.PCClarityCheck currentModel = form.SelectItem as Model.PCClarityCheck;
                if (currentModel != null)
                {
                    this._pcClarity = currentModel;
                    this._pcClarity = this._pcClarityManager.Get(this._pcClarity);
                    this.Refresh();
                }
            }
            form.Dispose();
            GC.Collect();
        }
Ejemplo n.º 13
0
        protected override void Delete()
        {
            if (this._pcClarity == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            this._pcClarityManager.Delete(this._pcClarity.PCClarityCheckId);

            this._pcClarity = this._pcClarityManager.GetNext(this._pcClarity);
            if (this._pcClarity == null)
            {
                this._pcClarity = this._pcClarityManager.GetLast();
            }
        }
Ejemplo n.º 14
0
 public void TiGuiExists(Model.PCClarityCheck model)
 {
     if (this.ExistsPrimary(model.PCClarityCheckId))
     {
         //设置KEY值
         string invoiceKind   = this.GetInvoiceKind().ToLower();
         string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, DateTime.Now.Year);
         string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, DateTime.Now.Year, DateTime.Now.Month);
         string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, DateTime.Now.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.PCClarityCheckId = this.GetId(DateTime.Now);
         TiGuiExists(model);
         //throw new Helper.InvalidValueException(Model.Product.PRO_Id);
     }
 }
Ejemplo n.º 15
0
        public RO(Model.PCClarityCheck PCClarityCheck)
        {
            InitializeComponent();

            if (PCClarityCheck == null)
            {
                return;
            }

            foreach (var detail in PCClarityCheck.Details)
            {
                foreach (var item in detail.GetType().GetProperties())
                {
                    if (item.Name.Contains("NoteIsPass"))
                    {
                        switch (item.GetValue(detail, null) == null ? null : item.GetValue(detail, null).ToString())
                        {
                        case "0":
                            item.SetValue(detail, "¡Ì", null);
                            break;

                        case "1":
                            item.SetValue(detail, "X", null);
                            break;

                        case "2":
                            item.SetValue(detail, "¡÷", null);
                            break;
                        }
                    }
                }
            }

            this.DataSource = PCClarityCheck.Details;  //.OrderBy(d => d.CheckDate).ToList()

            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblDataName.Text    = "ÇåÎú¶ÈœyÔ‡ˆó¸æ";
            //this.lblPriteDate.Text += DateTime.Now.ToShortDateString();

            this.lblPCClarityCheckID.Text  = PCClarityCheck.PCClarityCheckId;
            this.lblCheckDate.Text         = PCClarityCheck.CheckDate.HasValue ? PCClarityCheck.CheckDate.Value.ToShortDateString() : "";
            this.lblInvoiceCusXOId.Text    = PCClarityCheck.InvoiceCusXOId;
            this.lblPronoteHeaderId.Text   = PCClarityCheck.PronoteHeaderId;
            this.lblCheckStandard.Text     = PCClarityCheck.CheckStadard;
            this.lblProduct.Text           = PCClarityCheck.Product == null ? "" : PCClarityCheck.Product.ToString();
            this.lblEmployee.Text          = PCClarityCheck.Employee == null ? "" : PCClarityCheck.Employee.ToString();
            this.lblPCCheckCount.Text      = PCClarityCheck.CheckCount.HasValue ? PCClarityCheck.CheckCount.ToString() : "";
            this.lblInvoiceXOQuantity.Text = PCClarityCheck.InvoiceXOQuantity.HasValue ? PCClarityCheck.InvoiceXOQuantity.ToString() : "";
            this.lblUnit.Text     = PCClarityCheck.ProductUnit == null ? null : PCClarityCheck.ProductUnit.ToString();
            this.lblAuditEmp.Text = PCClarityCheck.AuditEmp == null ? null : PCClarityCheck.AuditEmp.ToString();
            this.RTNote.Rtf       = PCClarityCheck.Note;
            //this.lbl_CustomerProductName.Text = PCClarityCheck.Product == null ? "" : PCClarityCheck.Product.CustomerProductName;
            if (PCClarityCheck.Product != null)
            {
                if (string.IsNullOrEmpty(PCClarityCheck.Product.CustomerProductName))
                {
                    this.lbl_CustomerProductName.Text = new Help().GetCustomerProductNameByPronoteHeaderId(PCClarityCheck.PronoteHeaderId, PCClarityCheck.ProductId);
                }
                else
                {
                    this.lbl_CustomerProductName.Text = PCClarityCheck.Product.CustomerProductName;
                }
            }

            this.TC_Number.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_Number);
            this.TCDate.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_CheckDate, "{0:yyyy-MM-dd HH:mm:ss}");
            this.TCLeftD1.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_Left1);
            this.TCLeftD2.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_Left2);
            this.TCRightD1.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_Right1);
            this.TCRightD2.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_Right2);
            this.TCAstigmatismL.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_AstigmatismL);
            this.TCAstigmatismR.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_AstigmatismR);
            this.TCSphericaSurfaceL.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_SphericaSurfaceL);
            this.TCSphericaSurfaceR.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_SphericaSurfaceR);
            this.TCClarityL.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_ClarityL);
            this.TCClarityR.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_ClarityR);
            this.TCEmployee.DataBindings.Add("Text", this.DataSource, "Employee." + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.lblNote.DataBindings.Add("Text", this.DataSource, Model.PCClarityCheckDetail.PRO_NoteIsPass);

            this.xrLBusinessHours.DataBindings.Add("Text", this.DataSource, "BusinessHours." + Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME);
        }
Ejemplo n.º 16
0
 public void Update(Model.PCClarityCheck e)
 {
     this.Update <Model.PCClarityCheck>(e);
 }
Ejemplo n.º 17
0
 public bool HasRowsBefore(Model.PCClarityCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCClarityCheck.has_rows_before", e));
 }
Ejemplo n.º 18
0
 public bool HasRowsAfter(Model.PCClarityCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCClarityCheck.has_rows_after", e));
 }
Ejemplo n.º 19
0
 public Model.PCClarityCheck GetNext(Model.PCClarityCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCClarityCheck>("PCClarityCheck.get_next", e));
 }
Ejemplo n.º 20
0
 public Model.PCClarityCheck GetPrev(Model.PCClarityCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCClarityCheck>("PCClarityCheck.get_prev", e));
 }
Ejemplo n.º 21
0
 protected override void MoveFirst()
 {
     this._pcClarity = this._pcClarityManager.GetFirst();
 }
Ejemplo n.º 22
0
 public bool HasRowsBefore(Model.PCClarityCheck e)
 {
     return(accessor.HasRowsBefore(e));
 }
Ejemplo n.º 23
0
 public bool HasRowsAfter(Model.PCClarityCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }
Ejemplo n.º 24
0
 public Model.PCClarityCheck GetPrev(Model.PCClarityCheck e)
 {
     return(accessor.GetPrev(e));
 }
Ejemplo n.º 25
0
 public Model.PCClarityCheck GetNext(Model.PCClarityCheck e)
 {
     return(accessor.GetNext(e));
 }
Ejemplo n.º 26
0
 public void Insert(Model.PCClarityCheck e)
 {
     this.Insert <Model.PCClarityCheck>(e);
 }