Пример #1
0
 public void Validate(Model.PCEarplugsResilienceCheck model)
 {
     if (model.PCEarplugsResilienceCheckDate == null)
     {
         throw new Helper.InvalidValueException(Model.PCEarplugsResilienceCheck.PRO_PCEarplugsResilienceCheckDate);
     }
 }
Пример #2
0
        protected override void Delete()
        {
            if (this._pCEarplugsResilienceCheck == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            this._pCEarplugsResilienceCheckManager.Delete(this._pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId);

            if (this.sourceInvoice == 0)
            {
                this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetNext(this._pCEarplugsResilienceCheck);
                if (this._pCEarplugsResilienceCheck == null)
                {
                    this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetLast();
                }
            }
            else if (this.sourceInvoice == 1)
            {
                this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.PFCGetNext(this._pCEarplugsResilienceCheck.InsertTime.Value, this._PCFirstOnlineCheckDetailId);
                if (this._pCEarplugsResilienceCheck == null)
                {
                    this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.PFCGetLast(this._PCFirstOnlineCheckDetailId);
                }
            }
        }
Пример #3
0
        public ROResilience(Model.PCEarplugsResilienceCheck pCEarplugsResilienceCheck)
        {
            InitializeComponent();

            this.DataSource = pCEarplugsResilienceCheck.Details;

            this.lbl_CompanyName.Text = BL.Settings.CompanyChineseName;
            this.lbl_ReportDate.Text += DateTime.Now.ToString("yyyy-MM-dd");
            this.lbl_Note.Text        = pCEarplugsResilienceCheck.Note;
            this.lbl_Employee.Text    = pCEarplugsResilienceCheck.Employee == null ? "" : pCEarplugsResilienceCheck.Employee.ToString();

            this.TCDate.DataBindings.Add("Text", this.DataSource, "PCEarplugsResilienceCheck." + Model.PCEarplugsResilienceCheck.PRO_PCEarplugsResilienceCheckDate, "{0:yyyy-MM-dd}");
            this.TCFromId.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_FromId);
            this.TCCusXOId.DataBindings.Add("Text", this.DataSource, "InvoiceXO." + Model.InvoiceXO.PRO_CustomerInvoiceXOId);
            this.TCInvoiceQuantity.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_InvoiceXOQuantity);
            this.TCProduct.DataBindings.Add("Text", this.DataSource, "Product." + Model.Product.PRO_ProductName);
            this.TCProductUnit.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_ProductUnit);
            this.TCCheckedStandard.DataBindings.Add("Text", this.DataSource, "InvoiceXO.xocustomer." + Model.Customer.PRO_CheckedStandard);
            this.TCTestQuantity.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_TestQuantity);
            this.TCWaiguan.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_Waiguan);
            this.TCDuise.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_Duise);
            this.TCChicun.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_Chicun);
            this.TCJudge.DataBindings.Add("Text", this.DataSource, Model.PCEarplugsResilienceCheckDetail.PRO_Judge);

            this.xrSubreport1.ReportSource = new ROResilienceConditionSet(pCEarplugsResilienceCheck.TiekuaiyaCondition, pCEarplugsResilienceCheck.ShoucuorouCondition);
        }
Пример #4
0
        /// <summary>
        /// Update a PCEarplugsResilienceCheck.
        /// </summary>
        public void Update(Model.PCEarplugsResilienceCheck pCEarplugsResilienceCheck)
        {
            //
            // todo: add other logic here.
            //

            try
            {
                BL.V.BeginTransaction();

                Validate(pCEarplugsResilienceCheck);
                pCEarplugsResilienceCheck.UpdateTime = DateTime.Now;
                accessor.Update(pCEarplugsResilienceCheck);

                accessorDetail.DeleteByHeaderId(pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId);
                foreach (var item in pCEarplugsResilienceCheck.Details)
                {
                    item.PCEarplugsResilienceCheckId = pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId;

                    accessorDetail.Insert(item);
                }

                BL.V.CommitTransaction();
            }
            catch (Exception ex)
            {
                BL.V.RollbackTransaction();

                throw ex;
            }
        }
Пример #5
0
        public override void Refresh()
        {
            if (this._pCEarplugsResilienceCheck == null)
            {
                this.AddNew();
            }
            else
            {
                if (this.action == "view")
                {
                    this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetDetail(this._pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId);
                }
            }

            this.txt_Id.EditValue       = this._pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId;
            this.date_Check.EditValue   = this._pCEarplugsResilienceCheck.PCEarplugsResilienceCheckDate;
            this.ncc_Employee.EditValue = this._pCEarplugsResilienceCheck.Employee;
            this.cob_Tiekuaiya.Text     = this._pCEarplugsResilienceCheck.TiekuaiyaCondition;
            this.cob_Shoucuorou.Text    = this._pCEarplugsResilienceCheck.ShoucuorouCondition;
            this.txt_Note.EditValue     = this._pCEarplugsResilienceCheck.Note;

            this.bindingSourceDetail.DataSource = this._pCEarplugsResilienceCheck.Details;

            base.Refresh();

            switch (this.action)
            {
            case "view":
                //this.gridView1.OptionsBehavior.Editable = false;
                gridColumn3.OptionsColumn.AllowEdit  = false;
                gridColumn13.OptionsColumn.AllowEdit = false;
                gridColumn14.OptionsColumn.AllowEdit = false;
                gridColumn15.OptionsColumn.AllowEdit = false;
                gridColumn9.OptionsColumn.AllowEdit  = false;
                gridColumn4.OptionsColumn.AllowEdit  = false;
                gridColumn5.OptionsColumn.AllowEdit  = false;
                gridColumn6.OptionsColumn.AllowEdit  = false;
                gridColumn10.OptionsColumn.AllowEdit = false;
                break;

            default:
                //this.gridView1.OptionsBehavior.Editable = true;
                gridColumn3.OptionsColumn.AllowEdit  = true;
                gridColumn13.OptionsColumn.AllowEdit = true;
                gridColumn14.OptionsColumn.AllowEdit = true;
                gridColumn15.OptionsColumn.AllowEdit = true;
                gridColumn9.OptionsColumn.AllowEdit  = true;
                gridColumn4.OptionsColumn.AllowEdit  = true;
                gridColumn5.OptionsColumn.AllowEdit  = true;
                gridColumn6.OptionsColumn.AllowEdit  = true;
                gridColumn10.OptionsColumn.AllowEdit = true;
                break;
            }

            this.txt_Id.Properties.ReadOnly = true;

            this.gcTiekuaiya.Caption  = this._pCEarplugsResilienceCheck.TiekuaiyaCondition;
            this.gcShoucuorou.Caption = this._pCEarplugsResilienceCheck.ShoucuorouCondition;
        }
Пример #6
0
 protected override void MovePrev()
 {
     Model.PCEarplugsResilienceCheck PCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetPrev(this._pCEarplugsResilienceCheck);
     if (PCEarplugsResilienceCheck == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._pCEarplugsResilienceCheck = PCEarplugsResilienceCheck;
 }
Пример #7
0
 protected override void MoveLast()
 {
     if (this.LastFlag == 1)
     {
         this.LastFlag = 0;
         return;
     }
     this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetLast();
 }
Пример #8
0
 public Model.PCEarplugsResilienceCheck GetDetail(string pCEarplugsResilienceCheckId)
 {
     Model.PCEarplugsResilienceCheck model = this.Get(pCEarplugsResilienceCheckId);
     if (model != null)
     {
         model.Details = accessorDetail.SelectByHeaderId(pCEarplugsResilienceCheckId);
     }
     return(model);
 }
Пример #9
0
 protected override void MoveFirst()
 {
     if (this.sourceInvoice == 0)
     {
         this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetFirst();
     }
     else if (this.sourceInvoice == 1)
     {
         this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.PFCGetFirst(this._PCFirstOnlineCheckDetailId);
     }
 }
Пример #10
0
 public EditFormResilience(Model.PCEarplugsResilienceCheck pCEarplugsResilienceCheck)
     : this()
 {
     if (pCEarplugsResilienceCheck == null)
     {
         throw new ArithmeticException("PCEarplugsResilienceCheckId");
     }
     this._pCEarplugsResilienceCheck = pCEarplugsResilienceCheck;
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Пример #11
0
 int LastFlag = 0; //页面载 入时是否执行 last方法
 public EditFormResilience(string pCEarplugsResilienceCheckId)
     : this()
 {
     this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.Get(pCEarplugsResilienceCheckId);
     if (this._pCEarplugsResilienceCheck == null)
     {
         throw new ArithmeticException("PCEarplugsResilienceCheckId");
     }
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Пример #12
0
        protected override void MoveLast()
        {
            if (this.LastFlag == 1)
            {
                this.LastFlag = 0;
                return;
            }

            if (this.sourceInvoice == 0)
            {
                this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetLast();
            }
            else if (this.sourceInvoice == 1)
            {
                this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.Get(this._pCEarplugsResilienceCheckManager.PFCGetLast(this._PCFirstOnlineCheckDetailId) == null ? "" : this._pCEarplugsResilienceCheckManager.PFCGetLast(this._PCFirstOnlineCheckDetailId).PCEarplugsResilienceCheckId);
            }
        }
Пример #13
0
 private void TiGuiExists(Model.PCEarplugsResilienceCheck model)
 {
     if (this.ExistsPrimary(model.PCEarplugsResilienceCheckId))
     {
         //设置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.PCEarplugsResilienceCheckId = this.GetId(model.InsertTime.Value);
         TiGuiExists(model);
     }
 }
Пример #14
0
        protected override void Delete()
        {
            if (this._pCEarplugsResilienceCheck == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
            {
                return;
            }
            this._pCEarplugsResilienceCheckManager.Delete(this._pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId);

            this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetNext(this._pCEarplugsResilienceCheck);
            if (this._pCEarplugsResilienceCheck == null)
            {
                this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetLast();
            }
        }
Пример #15
0
        protected override void MovePrev()
        {
            Model.PCEarplugsResilienceCheck _pCEarplugsResilienceCheck = null;
            if (this.sourceInvoice == 0)
            {
                _pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetPrev(this._pCEarplugsResilienceCheck);
            }
            else if (this.sourceInvoice == 1)
            {
                _pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.PFCGetPrev(this._pCEarplugsResilienceCheck.InsertTime.Value, this._PCFirstOnlineCheckDetailId);
            }

            if (_pCEarplugsResilienceCheck == null)
            {
                throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
            }
            this._pCEarplugsResilienceCheck = _pCEarplugsResilienceCheck;
        }
Пример #16
0
        /// <summary>
        /// Insert a PCEarplugsResilienceCheck.
        /// </summary>
        public void Insert(Model.PCEarplugsResilienceCheck pCEarplugsResilienceCheck)
        {
            //
            // todo:add other logic here
            //
            try
            {
                BL.V.BeginTransaction();

                pCEarplugsResilienceCheck.InsertTime = DateTime.Now;
                pCEarplugsResilienceCheck.UpdateTime = DateTime.Now;


                Validate(pCEarplugsResilienceCheck);
                this.TiGuiExists(pCEarplugsResilienceCheck);

                accessor.Insert(pCEarplugsResilienceCheck);

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

                foreach (var item in pCEarplugsResilienceCheck.Details)
                {
                    item.PCEarplugsResilienceCheckId = pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId;

                    accessorDetail.Insert(item);
                }

                BL.V.CommitTransaction();
            }
            catch (Exception ex)
            {
                BL.V.RollbackTransaction();

                throw ex;
            }
        }
Пример #17
0
        protected override void AddNew()
        {
            this._pCEarplugsResilienceCheck = new Book.Model.PCEarplugsResilienceCheck();
            this._pCEarplugsResilienceCheck.PCEarplugsResilienceCheckId   = this._pCEarplugsResilienceCheckManager.GetId();
            this._pCEarplugsResilienceCheck.PCEarplugsResilienceCheckDate = DateTime.Now;

            this._pCEarplugsResilienceCheck.Employee   = BL.V.ActiveOperator.Employee;
            this._pCEarplugsResilienceCheck.EmployeeId = BL.V.ActiveOperator.EmployeeId;

            if (this.cob_Tiekuaiya.Properties.Items.Count > 0)
            {
                this._pCEarplugsResilienceCheck.TiekuaiyaCondition = this.cob_Tiekuaiya.Properties.Items[0].ToString();
            }
            if (this.cob_Shoucuorou.Properties.Items.Count > 0)
            {
                this._pCEarplugsResilienceCheck.ShoucuorouCondition = this.cob_Shoucuorou.Properties.Items[0].ToString();
            }

            this.action = "insert";
        }
Пример #18
0
        void ROResilience_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
            if (PCEarplugsResilienceCheck != null)
            {
                PCEarplugsResilienceCheck = manager.GetDetail(PCEarplugsResilienceCheck.PCEarplugsResilienceCheckId);
                this.DataSource           = PCEarplugsResilienceCheck.Details;

                ROResilienceConditionSet ro = this.xrSubreport1.ReportSource as ROResilienceConditionSet;
                if ((this.GetCurrentRow() as Model.PCEarplugsResilienceCheckDetail) != null)
                {
                    ro.PCEarplugsResilienceCheckDetailId = (this.GetCurrentRow() as Model.PCEarplugsResilienceCheckDetail).PCEarplugsResilienceCheckDetailId;
                }
                else
                {
                    this.xrSubreport1.ReportSource       = null;
                    ro.PCEarplugsResilienceCheckDetailId = null;
                }
                ro.TkyName = PCEarplugsResilienceCheck.TiekuaiyaCondition;
                ro.ScrName = PCEarplugsResilienceCheck.ShoucuorouCondition;
            }
            else
            {
                PCEarplugsResilienceCheck = new Book.Model.PCEarplugsResilienceCheck();
                this.DataSource           = new List <Model.PCEarplugsResilienceCheck>();

                ROResilienceConditionSet ro = this.xrSubreport1.ReportSource as ROResilienceConditionSet;
                if ((this.GetCurrentRow() as Model.PCEarplugsResilienceCheckDetail) != null)
                {
                    ro.PCEarplugsResilienceCheckDetailId = (this.GetCurrentRow() as Model.PCEarplugsResilienceCheckDetail).PCEarplugsResilienceCheckDetailId;
                }
                else
                {
                    this.xrSubreport1.ReportSource       = null;
                    ro.PCEarplugsResilienceCheckDetailId = null;
                }
                ro.TkyName = PCEarplugsResilienceCheck.TiekuaiyaCondition;
                ro.ScrName = PCEarplugsResilienceCheck.ShoucuorouCondition;
            }
        }
Пример #19
0
 protected override void MoveFirst()
 {
     this._pCEarplugsResilienceCheck = this._pCEarplugsResilienceCheckManager.GetFirst();
 }
 public void Insert(Model.PCEarplugsResilienceCheck e)
 {
     this.Insert <Model.PCEarplugsResilienceCheck>(e);
 }
 public void Update(Model.PCEarplugsResilienceCheck e)
 {
     this.Update <Model.PCEarplugsResilienceCheck>(e);
 }
 public bool HasRowsAfter(Model.PCEarplugsResilienceCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCEarplugsResilienceCheck.has_rows_after", e));
 }
Пример #23
0
 public bool PFCHasRowsAfter(Model.PCEarplugsResilienceCheck e, string PCFirstOnlineCheckDetailId)
 {
     return(accessor.PFCHasRowsAfter(e, PCFirstOnlineCheckDetailId));
 }
 public Model.PCEarplugsResilienceCheck GetPrev(Model.PCEarplugsResilienceCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCEarplugsResilienceCheck>("PCEarplugsResilienceCheck.get_prev", e));
 }
 public Model.PCEarplugsResilienceCheck GetNext(Model.PCEarplugsResilienceCheck e)
 {
     return(accessor.GetNext(e));
 }
 public bool HasRowsAfter(Model.PCEarplugsResilienceCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }