public void Delete(Model.PCEarPressCheck PCEarPressCheck)
 {
     if (PCEarPressCheck != null)
     {
         Delete(PCEarPressCheck.PCEarPressCheckId);
     }
 }
        /// <summary>
        /// Insert a PCEarPressCheck.
        /// </summary>
        public void Insert(Model.PCEarPressCheck pCEarPressCheck)
        {
            //
            // todo:add other logic here
            //
            Validate(pCEarPressCheck);
            try
            {
                BL.V.BeginTransaction();
                pCEarPressCheck.InsertTime = DateTime.Now;
                pCEarPressCheck.UpdateTime = DateTime.Now;
                accessor.Insert(pCEarPressCheck);

                foreach (Model.PCEarPressCheckDetail model in pCEarPressCheck.Details)
                {
                    detailManager.Insert(model);
                }
                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
Exemple #3
0
 protected override void MoveLast()
 {
     if (LastFlag == 1)
     {
         LastFlag = 0;
         return;
     }
     this._pcEarPress = this._pcEarPressManager.mGetLast(this.IsReport);
 }
Exemple #4
0
 protected override void AddNew()
 {
     this._pcEarPress = new Book.Model.PCEarPressCheck();
     this._pcEarPress.PCEarPressCheckId    = this._pcEarPressManager.GetId();
     this._pcEarPress.PCEarPressCheckDate  = DateTime.Now.Date;
     this._pcEarPress.PCEarPressCheckCount = 1;
     this._pcEarPress.Details = new List <Model.PCEarPressCheckDetail>();
     this.AddDataRows();
 }
Exemple #5
0
 protected override void MovePrev()
 {
     Model.PCEarPressCheck model = this._pcEarPressManager.mGetPrev(this._pcEarPress);
     if (model == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._pcEarPress = model;
 }
Exemple #6
0
 public EditForm(Model.PCEarPressCheck PCEarPressCheck, string action)
     : this()
 {
     this._pcEarPress = PCEarPressCheck;
     this.action      = action;
     if (this.action == action)
     {
         LastFlag = 1;
     }
 }
        public Model.PCEarPressCheck Get(Model.PCEarPressCheck pCEarPressCheck)
        {
            Model.PCEarPressCheck model = this.Get(pCEarPressCheck.PCEarPressCheckId);
            if (model != null)
            {
                model.Details = new PCEarPressCheckDetailManager().SelectByPCEarPressCheckId(pCEarPressCheck.PCEarPressCheckId);
            }

            return(model);
        }
 private void Validate(Model.PCEarPressCheck pCEarPressCheck)
 {
     if (pCEarPressCheck.ProductId == null)
     {
         throw new Helper.RequireValueException(Model.PCEarPressCheck.PRO_ProductId);
     }
     if (pCEarPressCheck.EmployeeId == null)
     {
         throw new Helper.RequireValueException(Model.PCEarPressCheck.PRO_EmployeeId);
     }
 }
Exemple #9
0
        public override void Refresh()
        {
            if (this._pcEarPress == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcEarPress = this._pcEarPressManager.Get(this._pcEarPress);
                }
            }
            this.txt_PCEarPressCheckId.Text     = this._pcEarPress.PCEarPressCheckId;
            this.txtPronoteHeaderId.Text        = this._pcEarPress.PronoteHeaderId;
            this.txtInvoiceCusXOId.Text         = this._pcEarPress.InvoiceCusXOId;
            this.ceInvoiceXOCount.EditValue     = this._pcEarPress.InvoiceXOQuantity.HasValue ? this._pcEarPress.InvoiceXOQuantity.Value : 0;
            this.calcPCCheckCount.EditValue     = this._pcEarPress.PCEarPressCheckCount.HasValue ? this._pcEarPress.PCEarPressCheckCount.Value : 0;
            this.Date_PCEarPressCheck.EditValue = this._pcEarPress.PCEarPressCheckDate;
            this.BEProduct.EditValue            = this._pcEarPress.Product;
            this.nccEmployee0.EditValue         = this._pcEarPress.Employee;
            this.txtCheckedStadard.Text         = this._pcEarPress.PCEarPressCheckStandard;
            //
            this.newChooseContorlAuditEmp.EditValue = this._pcEarPress.Employee;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._pcEarPress.AuditState);
            this.lookUpEditUnit.EditValue           = this._pcEarPress.ProductUnitId;
            this.richTextBoxNote.Rtf = this._pcEarPress.Note;
            //gridControl1.DataSource = bindingSourceDetail;
            this.bindingSourceDetail.DataSource = this._pcEarPress.Details;
            //repositoryItemLookUpEdit2.DataSource = this._pcEarPress.Employee;



            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_PCEarPressCheckId.ReadOnly = true;
        }
Exemple #10
0
        public RO(Model.PCEarPressCheck PCEarPressCheck)
        {
            InitializeComponent();
            if (PCEarPressCheck == null)
            {
                return;
            }


            this.DataSource          = PCEarPressCheck.Details.OrderBy(d => d.CheckDate).ToList();
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblReportName.Text  = "耳压制程测试报告";
            //this.lblPrintDate.Text += DateTime.Now.ToString("yyyy-MM-dd");

            lblPCEarPressCheckId.Text = PCEarPressCheck.PCEarPressCheckId;
            lblCheckCount.Text        = PCEarPressCheck.PCEarPressCheckCount.HasValue ? (PCEarPressCheck.PCEarPressCheckCount.ToString() + (PCEarPressCheck.ProductUnit == null ? "" : PCEarPressCheck.ProductUnit.ToString()) + "/每天") : "";
            lblCheckDate.Text         = PCEarPressCheck.PCEarPressCheckDate.HasValue ? PCEarPressCheck.PCEarPressCheckDate.Value.ToShortDateString() : "";
            lblCheckStandard.Text     = PCEarPressCheck.PCEarPressCheckStandard;
            lblInvoiceXOQuantity.Text = PCEarPressCheck.InvoiceXOQuantity.HasValue ? PCEarPressCheck.InvoiceXOQuantity.ToString() : "";
            lblInvpiceCusXOId.Text    = PCEarPressCheck.InvoiceCusXOId;
            lblProduct.Text           = PCEarPressCheck.Product == null ? "" : PCEarPressCheck.Product.ToString();
            lblPronoterHeaderId.Text  = PCEarPressCheck.PronoteHeaderId;
            //lblUnit.Text = PCEarPressCheck.ProductUnit == null ? null : PCEarPressCheck.ProductUnit.ToString();
            lblAuditEmp.Text = PCEarPressCheck.AuditEmp == null ? null : PCEarPressCheck.AuditEmp.ToString();
            lblEmployee.Text = PCEarPressCheck.Employee == null ? "" : PCEarPressCheck.Employee.ToString();
            RTNote.Rtf       = PCEarPressCheck.Note;
            //this.lbl_CustomerProductName.Text = PCEarPressCheck.Product == null ? "" : PCEarPressCheck.Product.CustomerProductName;
            if (PCEarPressCheck.Product != null)
            {
                if (string.IsNullOrEmpty(PCEarPressCheck.Product.CustomerProductName))
                {
                    this.lbl_CustomerProductName.Text = CommonHelp.GetCustomerProductNameByPronoteHeaderId(PCEarPressCheck.PronoteHeaderId, PCEarPressCheck.ProductId);
                }
                else
                {
                    this.lbl_CustomerProductName.Text = PCEarPressCheck.Product.CustomerProductName;
                }
            }

            TCDate.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckDate, "{0:yyyy-MM-dd}");
            TCHeadBound.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_HeadBand);
            TCTimeFir.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckTime, "{0:hh:mm}");
            TCTimeSec.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckTimeSec, "{0:hh:mm}");
            TCPressFir.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckPress);
            TCPressSec.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckPressSec);
            TCBoundFir.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckBound);
            TCBoundSec.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckBoundSec);
            TCEmployee.DataBindings.Add("Text", this.DataSource, "Employee." + Model.Employee.PROPERTY_EMPLOYEENAME);
            TCNote.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_NoteIsPass);
            CTimeFirStandard.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckStandard);
            CTimeFSecStandard.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckStandardW);
            this.xrLBusinessHours.DataBindings.Add("Text", this.DataSource, "BusinessHours." + Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME);
        }
Exemple #11
0
 public EditForm(Model.PCEarPressCheck PCEarPressCheck) : this()
 {
     if (PCEarPressCheck == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this._pcEarPress = PCEarPressCheck;
     this.action      = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Exemple #12
0
        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm form = new ListForm(this.IsReport);

            if (form.ShowDialog(this) == DialogResult.OK)
            {
                Model.PCEarPressCheck currentModel = form.SelectItem as Model.PCEarPressCheck;
                if (currentModel != null)
                {
                    this._pcEarPress = currentModel;
                    this._pcEarPress = this._pcEarPressManager.Get(this._pcEarPress);
                    this.Refresh();
                }
            }
            form.Dispose();
            GC.Collect();
        }
Exemple #13
0
 protected override void Delete()
 {
     if (this._pcEarPress == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this._pcEarPressManager.Delete(this._pcEarPress.PCEarPressCheckId);
     this._pcEarPress = this._pcEarPressManager.GetNext(this._pcEarPress);
     if (this._pcEarPress == null)
     {
         this._pcEarPress = this._pcEarPressManager.GetLast();
     }
 }
 public void TiGuiExists(Model.PCEarPressCheck model)
 {
     if (this.ExistsPrimary(model.PCEarPressCheckId))
     {
         //设置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.PCEarPressCheckId = this.GetId(DateTime.Now);
         TiGuiExists(model);
         //throw new Helper.InvalidValueException(Model.Product.PRO_Id);
     }
 }
Exemple #15
0
        public RO(Model.PCEarPressCheck PCEarPressCheck)
        {
            InitializeComponent();
            if (PCEarPressCheck == null)
            {
                return;
            }


            this.DataSource          = PCEarPressCheck.Details;
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblReportName.Text  = Properties.Resources.ClarityReport;
            this.lblPrintDate.Text  += DateTime.Now.ToLongDateString();

            lblPCEarPressCheckId.Text = PCEarPressCheck.PCEarPressCheckId;
            lblCheckCount.Text        = PCEarPressCheck.PCEarPressCheckCount.HasValue?PCEarPressCheck.PCEarPressCheckCount.ToString():"";
            lblCheckDate.Text         = PCEarPressCheck.PCEarPressCheckDate.HasValue ? PCEarPressCheck.PCEarPressCheckDate.Value.ToShortDateString() : "";
            lblCheckStandard.Text     = PCEarPressCheck.PCEarPressCheckStandard;
            lblInvoiceXOQuantity.Text = PCEarPressCheck.InvoiceXOQuantity.HasValue?PCEarPressCheck.InvoiceXOQuantity.ToString():"";
            lblInvpiceCusXOId.Text    = PCEarPressCheck.InvoiceCusXOId;
            lblProduct.Text           = PCEarPressCheck.Product == null ? "" : PCEarPressCheck.Product.ToString();
            lblPronoterHeaderId.Text  = PCEarPressCheck.PronoteHeaderId;
            lblUnit.Text     = PCEarPressCheck.ProductUnit == null? "":PCEarPressCheck.ProductUnit.ToString();
            lblAuditEmp.Text = PCEarPressCheck.AuditEmp == null ? "" : PCEarPressCheck.AuditEmp.ToString();
            lblEmployee.Text = PCEarPressCheck.Employee == null ? "" : PCEarPressCheck.Employee.ToString();
            RTNote.Text      = PCEarPressCheck.Note;


            TCDate.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckDate, "{0:yyyy-mm-dd hh:mm:ss}");
            TCHeadBound.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_HeadBand);
            TCTimeFir.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckTime);
            TCTimeSec.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckTimeSec);
            CTimeFirStandard.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckStandard);
            CTimeSecStangard.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckStandardW);
            TCPressFir.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckPress);
            TCPressSec.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckPressSec);
            TCBoundFir.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckBound);
            TCBoundSec.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_CheckBoundSec);
            TCEmployee.DataBindings.Add("Text", this.DataSource, "Employee" + Model.Employee.PROPERTY_EMPLOYEENAME);
            this.TCNote.DataBindings.Add("Text", this.DataSource, Model.PCEarPressCheckDetail.PRO_NoteIsPass);
        }
Exemple #16
0
 protected override void MoveFirst()
 {
     this._pcEarPress = this._pcEarPressManager.GetFirst();
 }
Exemple #17
0
 protected override void MoveFirst()
 {
     this._pcEarPress = this._pcEarPressManager.mGetFirst(this.IsReport);
 }
 public Model.PCEarPressCheck mGetPrev(Model.PCEarPressCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCEarPressCheck>("PCEarPressCheck.mget_prev", e));
 }
 public void Update(Model.PCEarPressCheck e)
 {
     this.Update <Model.PCEarPressCheck>(e);
 }
 public bool HasRowsAfter(Model.PCEarPressCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }
 public Model.PCEarPressCheck mGetPrev(Model.PCEarPressCheck e)
 {
     return(accessor.mGetPrev(e));
 }
 public bool mHasRowsBefore(Model.PCEarPressCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCEarPressCheck.mhas_rows_before", e));
 }
 public bool mHasRowsAfter(Model.PCEarPressCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCEarPressCheck.mhas_rows_after", e));
 }
 public bool HasRowsBefore(Model.PCEarPressCheck e)
 {
     return(accessor.HasRowsBefore(e));
 }
 public Model.PCEarPressCheck mGetNext(Model.PCEarPressCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCEarPressCheck>("PCEarPressCheck.mget_next", e));
 }
 public Model.PCEarPressCheck GetNext(Model.PCEarPressCheck e)
 {
     return(accessor.GetNext(e));
 }
 public void Insert(Model.PCEarPressCheck e)
 {
     this.Insert <Model.PCEarPressCheck>(e);
 }