コード例 #1
0
ファイル: RO.cs プロジェクト: daobataotie/Mobe
        //IList<Model.ANSIPCImpactCheckDetail> details = new List<Model.ANSIPCImpactCheckDetail>();
        //BL.ANSIPCImpactCheckDetailManager ansipcicManager = new Book.BL.ANSIPCImpactCheckDetailManager();

        public RO(Model.PCFogCheck mPCFogC)
        {
            InitializeComponent();

            if (mPCFogC == null)
            {
                return;
            }

            this.DataSource = mPCFogC.Details;
            //details = ansipcicManager.SelectByAnispcicID(ANSIPCIC.ANSIPCImpactCheckID);
            //this.DataSource = details;

            //CompanyInfo
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblDataName.Text    = Properties.Resources.PCFogCheck;
            //this.lblPriteDate.Text += DateTime.Now.ToShortDateString();

            //Control
            this.lblPCFogCheckId.Text       = mPCFogC.PCFogCheckId;
            this.lblPCFogCheckDate.Text     = mPCFogC.PCFogCheckDate.HasValue ? mPCFogC.PCFogCheckDate.Value.ToShortDateString() : "";
            this.lblInvoiceCusXOId.Text     = mPCFogC.InvoiceCusXOId;
            this.lblPronoteHeaderId.Text    = mPCFogC.PronoteHeaderId;
            this.lblProduct.Text            = mPCFogC.Product == null ? "" : mPCFogC.Product.ToString();
            this.lblEmployee.Text           = mPCFogC.Employee == null ? "" : mPCFogC.Employee.ToString();
            this.RTDescript.Text            = mPCFogC.PCFogCheckDesc;
            this.lblCheckStandard.Text      = mPCFogC.mCheckStandard;
            this.lblPCFogCheckQuantity.Text = mPCFogC.PCFogCheckQuantity.HasValue ? mPCFogC.PCFogCheckQuantity.ToString() : "";
            this.lblInvoiceXOQuantity.Text  = mPCFogC.InvoiceXOQuantity.HasValue ? mPCFogC.InvoiceXOQuantity.ToString() : "";
            this.ChkIsPassWuDu.Checked      = mPCFogC.IsFogPassing.HasValue ? mPCFogC.IsFogPassing.Value : false;
            this.lbl_productunit.Text       = mPCFogC.ProductUnit == null ? "" : mPCFogC.ProductUnit.ToString();
            this.lbl_MaterailUnit.Text      = mPCFogC.MaterialUnit;
            //this.lbl_CustomerProductName.Text = mPCFogC.Product == null ? "" : mPCFogC.Product.CustomerProductName;
            if (mPCFogC.Product != null)
            {
                if (string.IsNullOrEmpty(mPCFogC.Product.CustomerProductName))
                {
                    this.lbl_CustomerProductName.Text = CommonHelp.GetCustomerProductNameByPronoteHeaderId(mPCFogC.PronoteHeaderId, mPCFogC.ProductId);
                }
                else
                {
                    this.lbl_CustomerProductName.Text = mPCFogC.Product.CustomerProductName;
                }
            }

            //Details
            this.TCChkPassL.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingL);
            this.TCChkPassR.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingR);
            this.TClblCL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCL);
            this.TClblCR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCR);
            this.TClblCommentL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentLTime, "{0:yyyy-MM-dd HH:mm}");
            this.TClblCommentR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentRTime, "{0:yyyy-MM-dd HH:mm}");
            this.TClblHL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHL);
            this.TClblHR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHR);
            this.TClblTL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTL);
            this.TClblTR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTR);
            this.TClblMethod.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_Method);
            xrLBusinessHours.DataBindings.Add("Text", this.DataSource, "BusinessHours." + Model.BusinessHours.PROPERTY_BUSINESSHOURSNAME);
            this.TCCheckStandard.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CheckStandard);
        }
コード例 #2
0
 protected override void MoveNext()
 {
     Model.PCFogCheck mPCFog = this._pcfogManager.GetNext(this._pcfog);
     if (mPCFog == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._pcfog = this._pcfogManager.Get(mPCFog.PCFogCheckId);
 }
コード例 #3
0
 protected override void MoveLast()
 {
     if (this.LastFlag == 1)
     {
         this.LastFlag = 0;
         return;
     }
     this._pcfog = this._pcfogManager.GetLast();
 }
コード例 #4
0
 public EditForm(Model.PCFogCheck mPCFogCheck, string action)
     : this()
 {
     this._pcfog = mPCFogCheck;
     this.action = action;
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
コード例 #5
0
        public override void Refresh()
        {
            if (this._pcfog == null)
            {
                this.AddNew();
                this.action = "insert";
            }
            else
            {
                if (this.action == "view")
                {
                    this._pcfog = this._pcfogManager.GetDetail(this._pcfog.PCFogCheckId);
                }
            }

            //初始化控件
            this.txtPCFogCheckId.Text             = this._pcfog.PCFogCheckId;
            this.txtPronoteHeaderId.Text          = this._pcfog.PronoteHeaderId;
            this.txtInvoiceCusXOId.Text           = this._pcfog.InvoiceCusXOId;
            this.txtPCFogCheckDesc.Text           = this._pcfog.PCFogCheckDesc;
            this.ceInvoiceXOCount.Text            = (this._pcfog.InvoiceXOQuantity.HasValue ? this._pcfog.InvoiceXOQuantity.Value : 0).ToString();
            this.calcPCFogCheckQuantity.EditValue = this._pcfog.PCFogCheckQuantity.HasValue ? this._pcfog.PCFogCheckQuantity.Value : 0;
            this.DE_PCFogCheckDate.EditValue      = this._pcfog.PCFogCheckDate.Value;
            this.BEProduct.EditValue     = this._pcfog.Product;
            this.nccEmployee0.EditValue  = this._pcfog.Employee;
            this.txtCheckedStandard.Text = this._pcfog.mCheckStandard;

            this.chkEditWDCS.Checked = this._pcfog.IsFogPassing.HasValue ? this._pcfog.IsFogPassing.Value : false;
            this.newChooseContorlAuditEmp.EditValue = this._pcfog.AuditEmp;
            this.txt_AuditState.EditValue           = this.GetAuditName(this._pcfog.AuditState);
            this.lookUpEditUnit.EditValue           = this._pcfog.ProductUnitId;
            this.cob_MaterailUnit.Text = this._pcfog.MaterialUnit;

            this.bindingSource1.DataSource = this._pcfog.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.txtPCFogCheckId.Properties.ReadOnly = true;
            this.ceInvoiceXOCount.Enabled            = false;
            this.txtPCFogCheckId.Enabled             = false;
        }
コード例 #6
0
ファイル: ListForm.cs プロジェクト: daobataotie/Mobe
        private void btn_OK_Click(object sender, EventArgs e)
        {
            IList <Model.PCFogCheck> list = this.bindingSource1.DataSource as IList <Model.PCFogCheck>;

            if (list != null)
            {
                Model.PCFogCheck pcFogCheck = list.FirstOrDefault(P => P.IsChecked == true);
                if (pcFogCheck != null)
                {
                    this.PCFogCheckId = pcFogCheck.PCFogCheckId;
                }
            }
            this.DialogResult = DialogResult.OK;
        }
コード例 #7
0
 public EditForm(string invoiceId)
     : this()
 {
     this._pcfog = this._pcfogManager.Get(invoiceId);
     if (this._pcfog == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
コード例 #8
0
 public EditForm(Model.PCFogCheck mPCFogCheck)
     : this()
 {
     if (mPCFogCheck == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this._pcfog = mPCFogCheck;
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
コード例 #9
0
        //选择测试单据
        private void barBtnSearch_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ListForm f = new ListForm();

            if (f.ShowDialog(this) == DialogResult.OK)
            {
                Model.PCFogCheck currentModel = f.SelectItem as Model.PCFogCheck;
                if (currentModel != null)
                {
                    this._pcfog = currentModel;
                    this._pcfog = this._pcfogManager.GetDetail(this._pcfog.PCFogCheckId);
                    this.Refresh();
                }
            }
            f.Dispose();
            GC.Collect();
        }
コード例 #10
0
        protected override void AddNew()
        {
            this._pcfog = new Book.Model.PCFogCheck();
            this._pcfog.PCFogCheckId       = this._pcfogManager.GetId();
            this._pcfog.PCFogCheckDate     = DateTime.Now.Date;
            this._pcfog.PCFogCheckQuantity = 1;     //默认检测数量为1

            this._pcfog.Details = new List <Model.PCFogCheckDetail>();
            Model.PCFogCheckDetail pcfcd = new Book.Model.PCFogCheckDetail();
            pcfcd.PCImpactCheckDetailId = Guid.NewGuid().ToString();
            pcfcd.PCFogCheckId          = this._pcfog.PCFogCheckId;
            pcfcd.CommentLDate          = DateTime.Now;
            pcfcd.CommentLTime          = DateTime.Now;
            pcfcd.CommentRDate          = DateTime.Now;
            pcfcd.CommentRTime          = DateTime.Now;
            this._pcfog.Details.Add(pcfcd);
        }
コード例 #11
0
ファイル: PCFogCheckManager.cs プロジェクト: daobataotie/Mobe
        public void Delete(Model.PCFogCheck pcfc)
        {
            try
            {
                BL.V.BeginTransaction();

                new BL.PCFogCheckDetailManager().DeleteByHeaderId(pcfc.PCFogCheckId);

                this.Delete(pcfc.PCFogCheckId);

                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
コード例 #12
0
ファイル: PCFogCheckManager.cs プロジェクト: daobataotie/Mobe
 private void TiGuiExists(Model.PCFogCheck model)
 {
     if (this.ExistsPrimary(model.PCFogCheckId))
     {
         //设置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.PCFogCheckId = this.GetId(model.InsertTime.Value);
         TiGuiExists(model);
     }
 }
コード例 #13
0
ファイル: PCFogCheckManager.cs プロジェクト: daobataotie/Mobe
        public void Update(Model.PCFogCheck pCFogCheck)
        {
            if (pCFogCheck != null)
            {
                Validate(pCFogCheck);

                pCFogCheck.UpdateTime = DateTime.Now;

                accessor.Update(pCFogCheck);

                new PCFogCheckDetailManager().DeleteByHeaderId(pCFogCheck.PCFogCheckId);

                foreach (Model.PCFogCheckDetail d in pCFogCheck.Details)
                {
                    new PCFogCheckDetailManager().Insert(d);
                }
            }
        }
コード例 #14
0
ファイル: RO.cs プロジェクト: daobataotie/Jianli-en
        //IList<Model.ANSIPCImpactCheckDetail> details = new List<Model.ANSIPCImpactCheckDetail>();
        //BL.ANSIPCImpactCheckDetailManager ansipcicManager = new Book.BL.ANSIPCImpactCheckDetailManager();

        public RO(Model.PCFogCheck mPCFogC)
        {
            InitializeComponent();

            if (mPCFogC == null)
            {
                return;
            }

            this.DataSource = mPCFogC.Details;
            //details = ansipcicManager.SelectByAnispcicID(ANSIPCIC.ANSIPCImpactCheckID);
            //this.DataSource = details;

            //CompanyInfo
            this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
            this.lblDataName.Text    = Properties.Resources.PCFogCheck;
            this.lblPriteDate.Text  += DateTime.Now.ToShortDateString();

            //Control
            this.lblPCFogCheckId.Text       = mPCFogC.PCFogCheckId;
            this.lblPCFogCheckDate.Text     = mPCFogC.PCFogCheckDate.HasValue ? mPCFogC.PCFogCheckDate.Value.ToShortDateString() : "";
            this.lblInvoiceCusXOId.Text     = mPCFogC.InvoiceCusXOId;
            this.lblPronoteHeaderId.Text    = mPCFogC.PronoteHeaderId;
            this.lblProduct.Text            = mPCFogC.Product == null ? "" : mPCFogC.Product.ToString();
            this.lblEmployee.Text           = mPCFogC.Employee == null ? "" : mPCFogC.Employee.ToString();
            this.RTDescript.Text            = mPCFogC.PCFogCheckDesc;
            this.lblCheckStandard.Text      = mPCFogC.mCheckStandard;
            this.lblPCFogCheckQuantity.Text = mPCFogC.PCFogCheckQuantity.HasValue ? mPCFogC.PCFogCheckQuantity.ToString() : "";
            this.lblInvoiceXOQuantity.Text  = mPCFogC.InvoiceXOQuantity.HasValue ? mPCFogC.InvoiceXOQuantity.ToString() : "";
            this.ChkIsPassWuDu.Checked      = mPCFogC.IsFogPassing.HasValue ? mPCFogC.IsFogPassing.Value : false;
            this.lbl_productunit.Text       = mPCFogC.ProductUnit == null ? "" : mPCFogC.ProductUnit.ToString();
            //Details
            this.TCChkPassL.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingL);
            this.TCChkPassR.DataBindings.Add("Checked", this.DataSource, Model.PCFogCheckDetail.PRO_PassingR);
            this.TClblCL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCL);
            this.TClblCR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrCR);
            this.TClblCommentL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentLTime);
            this.TClblCommentR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_CommentRTime);
            this.TClblHL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHL);
            this.TClblHR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrHR);
            this.TClblTL.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTL);
            this.TClblTR.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_attrTR);
            this.TClblMethod.DataBindings.Add("Text", this.DataSource, Model.PCFogCheckDetail.PRO_Method);
        }
コード例 #15
0
        protected override void Delete()
        {
            if (this._pcfog == null)
            {
                return;
            }
            if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK)
            {
                return;
            }
            this._pcfogManager.Delete(this._pcfog);

            this._pcfog = this._pcfogManager.GetNext(this._pcfog);

            if (this._pcfog == null)
            {
                this._pcfog = this._pcfogManager.GetLast();
            }
        }
コード例 #16
0
        public void Update(Model.PCFogCheck pCFogCheck)
        {
            if (pCFogCheck != null)
            {
                Validate(pCFogCheck);

                pCFogCheck.UpdateTime = DateTime.Now;

                accessor.Update(pCFogCheck);

                this._pcfogcheckdetailmanager.DeleteByHeaderId(pCFogCheck.PCFogCheckId);

                foreach (Model.PCFogCheckDetail d in pCFogCheck.Details)
                {
                    d.PCFogCheckId = pCFogCheck.PCFogCheckId;
                    this._pcfogcheckdetailmanager.Insert(d);
                }
            }
        }
コード例 #17
0
        protected override void AddNew()
        {
            this._pcfog = new Book.Model.PCFogCheck();
            this._pcfog.PCFogCheckId       = this._pcfogManager.GetId();
            this._pcfog.PCFogCheckDate     = DateTime.Now.Date;
            this._pcfog.PCFogCheckQuantity = 6;                                      //默认检测数量为1
            this._pcfog.ProductUnitId      = "f7f95879-3444-494b-92eb-2aa784c52e8c"; //默认单位PCS

            this._pcfog.Details = new List <Model.PCFogCheckDetail>();
            Model.PCFogCheckDetail pcfcd = new Book.Model.PCFogCheckDetail();
            pcfcd.PCImpactCheckDetailId = Guid.NewGuid().ToString();
            pcfcd.PCFogCheckId          = this._pcfog.PCFogCheckId;
            pcfcd.CommentLDate          = DateTime.Now;
            pcfcd.CommentLTime          = DateTime.Now;
            pcfcd.CommentRDate          = DateTime.Now;
            pcfcd.CommentRTime          = DateTime.Now;
            pcfcd.CheckStandard         = this.repositoryItemComboBox1.Items[0].ToString();
            this._pcfog.Details.Add(pcfcd);
        }
コード例 #18
0
ファイル: PCFogCheckManager.cs プロジェクト: daobataotie/Mobe
 private void Validate(Model.PCFogCheck mPCFog)
 {
     if (string.IsNullOrEmpty(mPCFog.PCFogCheckId))
     {
         throw new Helper.RequireValueException(Model.PCFogCheck.PRO_PCFogCheckId);
     }
     if (string.IsNullOrEmpty(mPCFog.ProductId))
     {
         throw new Helper.RequireValueException(Model.PCFogCheck.PRO_ProductId);
     }
     if (string.IsNullOrEmpty(mPCFog.PCFogCheckDate.ToString()))
     {
         throw new Helper.RequireValueException(Model.PCFogCheck.PRO_PCFogCheckDate);
     }
     if (string.IsNullOrEmpty(mPCFog.EmployeeId))
     {
         throw new Helper.RequireValueException(Model.PCFogCheck.PRO_EmployeeId);
     }
 }
コード例 #19
0
ファイル: PCFogCheckManager.cs プロジェクト: daobataotie/Mobe
        public void Insert(Model.PCFogCheck pCFogCheck)
        {
            Validate(pCFogCheck);
            try
            {
                BL.V.BeginTransaction();

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

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

                foreach (Model.PCFogCheckDetail d in pCFogCheck.Details)
                {
                    d.PCFogCheckId = pCFogCheck.PCFogCheckId;
                    new PCFogCheckDetailManager().Insert(d);
                }

                BL.V.CommitTransaction();
            }
            catch
            {
                BL.V.RollbackTransaction();
                throw;
            }
        }
コード例 #20
0
 public Model.PCFogCheck GetPrev(Model.PCFogCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCFogCheck>("PCFogCheck.get_prev", e));
 }
コード例 #21
0
 public bool HasRowsAfter(Model.PCFogCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCFogCheck.has_rows_after", e));
 }
コード例 #22
0
 public bool HasRowsAfter(Model.PCFogCheck e)
 {
     return(accessor.HasRowsAfter(e));
 }
コード例 #23
0
 public bool HasRowsBefore(Model.PCFogCheck e)
 {
     return(accessor.HasRowsBefore(e));
 }
コード例 #24
0
 public Model.PCFogCheck GetNext(Model.PCFogCheck e)
 {
     return(accessor.GetNext(e));
 }
コード例 #25
0
 public Model.PCFogCheck GetPrev(Model.PCFogCheck e)
 {
     return(accessor.GetPrev(e));
 }
コード例 #26
0
 public Model.PCFogCheck GetDetail(string PCFogCheckId)
 {
     Model.PCFogCheck p = accessor.Get(PCFogCheckId);
     p.Details = this._pcfogcheckdetailmanager.Select(PCFogCheckId);
     return(p);
 }
コード例 #27
0
 protected override void MoveFirst()
 {
     this._pcfog = this._pcfogManager.GetFirst();
 }
コード例 #28
0
 public bool HasRowsBefore(Model.PCFogCheck e)
 {
     return(sqlmapper.QueryForObject <bool>("PCFogCheck.has_rows_before", e));
 }
コード例 #29
0
 public Model.PCFogCheck GetNext(Model.PCFogCheck e)
 {
     return(sqlmapper.QueryForObject <Model.PCFogCheck>("PCFogCheck.get_next", e));
 }
コード例 #30
0
ファイル: PCFogCheckManager.cs プロジェクト: daobataotie/Mobe
 public Model.PCFogCheck GetDetail(string PCFogCheckId)
 {
     Model.PCFogCheck p = accessor.Get(PCFogCheckId);
     p.Details = new BL.PCFogCheckDetailManager().Select(PCFogCheckId);
     return(p);
 }