Ejemplo n.º 1
0
 private void Validate(Model.InvoiceZG invoicezg)
 {
     if (invoicezg.InvoiceZGDate == null)
     {
         throw new Helper.RequireValueException(Model.InvoiceZG.PRO_InvoiceZGDate);
     }
 }
Ejemplo n.º 2
0
 protected override void MoveLast()
 {
     if (LastFlag == 1)
     {
         LastFlag = 0;
         return;
     }
     this._invoiceZG = this._invoiceZGManager.GetLast();
 }
Ejemplo n.º 3
0
 protected override void MovePrev()
 {
     Model.InvoiceZG invoiceZG = this._invoiceZGManager.GetPrev(this._invoiceZG);
     if (invoiceZG == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this._invoiceZG = invoiceZG;
 }
Ejemplo n.º 4
0
 protected override void AddNew()
 {
     this._invoiceZG             = new Book.Model.InvoiceZG();
     this._invoiceZG.InvoiceZGId = this._invoiceZGManager.GetId();
     this._invoiceZGManager.TiGuiExists(this._invoiceZG);
     this._invoiceZG.InvoiceZGDate = DateTime.Now;
     this._invoiceZG.Details       = new List <Model.InvoiceZGDetail>();
     this.action = "insert";
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Update a InvoiceZG.
 /// </summary>
 public void Update(Model.InvoiceZG invoiceZG)
 {
     //
     // todo: add other logic here.
     //
     Validate(invoiceZG);
     invoiceZG.UpdateTime = DateTime.Now;
     accessor.Update(invoiceZG);
     (new InvoiceZGDetailManager()).DeleteByInvoiceZGId(invoiceZG.InvoiceZGId);
     foreach (Model.InvoiceZGDetail detai in invoiceZG.Details)
     {
         (new InvoiceZGDetailManager()).Insert(detai);
     }
 }
Ejemplo n.º 6
0
 int LastFlag = 0; //页面载入时是否执行 last方法
 public EditForm(string invoiceId)
     : this()
 {
     this._invoiceZG = this._invoiceZGManager.Get(invoiceId);
     if (this._invoiceZG == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this.action = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Ejemplo n.º 7
0
 public EditForm(Model.InvoiceZG invoice)
     : this()
 {
     if (invoice == null)
     {
         throw new ArithmeticException("invoiceid");
     }
     this._invoiceZG = invoice;
     this.action     = "view";
     if (this.action == "view")
     {
         LastFlag = 1;
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Insert a InvoiceZG.
 /// </summary>
 public void Insert(Model.InvoiceZG invoiceZG)
 {
     //
     // todo:add other logic here
     //
     //TiGuiExists(invoiceZG);
     Validate(invoiceZG);
     invoiceZG.InsertTime = DateTime.Now;
     invoiceZG.UpdateTime = DateTime.Now;
     accessor.Insert(invoiceZG);
     foreach (Model.InvoiceZGDetail detai in invoiceZG.Details)
     {
         (new InvoiceZGDetailManager()).Insert(detai);
     }
 }
Ejemplo n.º 9
0
 protected override void Delete()
 {
     if (this._invoiceZG == null)
     {
         return;
     }
     if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
     {
         this._invoiceZGManager.Delete(this._invoiceZG.InvoiceZGId);
         this._invoiceZG = this._invoiceZGManager.GetNext(this._invoiceZG);
         if (this._invoiceZG == null)
         {
             this._invoiceZG = this._invoiceZGManager.GetLast();
         }
     }
 }
Ejemplo n.º 10
0
 public void TiGuiExists(Model.InvoiceZG model)
 {
     if (this.ExistsPrimary(model.InvoiceZGId))
     {
         //设置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.InvoiceZGId = this.GetId(DateTime.Now);
         TiGuiExists(model);
         //throw new Helper.InvalidValueException(Model.Product.PRO_Id);
     }
 }
Ejemplo n.º 11
0
        public override void Refresh()
        {
            if (this._invoiceZG == null)
            {
                AddNew();
            }
            else
            {
                if (this.action == "view")
                {
                    this._invoiceZG = this._invoiceZGManager.Get(_invoiceZG.InvoiceZGId);
                }
            }

            this.txt_InvoiceId.EditValue       = this._invoiceZG.InvoiceZGId;
            this.date_InvoiceDate.EditValue    = this._invoiceZG.InvoiceZGDate;
            this.newChooseEmployee.EditValue   = this._invoiceZG.Employee;
            this.newChooseXOCustomer.EditValue = this._invoiceZG.XOCustomer;
            if (this.newChooseXOCustomer.EditValue != null)
            {
                this.txt_ToName.EditValue    = this._invoiceZG.XOCustomer.CustomerFullName;
                this.txt_ToAddress.EditValue = this._invoiceZG.XOCustomer.CustomerAddress;
            }
            else
            {
                this.txt_ToName.EditValue    = null;
                this.txt_ToAddress.EditValue = null;
            }
            this.lookUpEditSHIPPED.EditValue = this._invoiceZG.ShippedBy;
            this.txt_PER.EditValue           = this._invoiceZG.PerSS;
            this.txt_SO.EditValue            = this._invoiceZG.SorO;
            this.txt_SHIPPED.EditValue       = this._invoiceZG.ShippedOnAbout;
            this.txt_ARRIVEL.EditValue       = this._invoiceZG.ArrivelOnAbout;
            this.me_From.EditValue           = this._invoiceZG.AddressFrom;
            this.me_To.EditValue             = this._invoiceZG.AddressTo;
            this.richTextInvoiceZGDes.Rtf    = this._invoiceZG.InvoiceZGDes;


            this._invoiceZG.Details             = this._invoiceZGDetailManager.SelectByInvoiceZGId(this._invoiceZG.InvoiceZGId);
            this.bindingSourceDetail.DataSource = this._invoiceZG.Details;
            base.Refresh();
        }
Ejemplo n.º 12
0
        public RO(Model.InvoiceZG invoiceZG)
            : this()
        {
            if (invoiceZG != null)
            {
                this.lblCompanyName.Text = BL.Settings.CompanyChineseName;
                this.lblReportName.Text  = Properties.Resources.InvoiceZG;
                this.lblReportDate.Text += DateTime.Now.ToString("yyyy-MM-dd");

                this.lblInvoiceNO.Text   = invoiceZG.InvoiceZGId;
                this.lblInvoiceDate.Text = invoiceZG.InvoiceZGDate != null?invoiceZG.InvoiceZGDate.Value.ToString("yyyy-MM-dd") : null;

                this.lblInvoiceOF.Text       = invoiceZG.XOCustomer.ToString();
                this.lblInvoiceTO_1.Text     = invoiceZG.XOCustomer.CustomerFullName;
                this.lblInvoiceTO_2.Text     = invoiceZG.XOCustomer.CustomerAddress;
                this.lblShippedBy.Text       = invoiceZG.Shipped.CompanyName;
                this.lblPerSS.Text           = invoiceZG.PerSS;
                this.lblS_O.Text             = invoiceZG.SorO;
                this.lblShippedON_About.Text = invoiceZG.ShippedOnAbout;
                this.lblArrivel_ONAbout.Text = invoiceZG.ArrivelOnAbout;
                this.lblInvoice_AddFrom.Text = invoiceZG.AddressFrom;
                this.lblInvoice_AddTo.Text   = invoiceZG.AddressTo;
            }
        }
Ejemplo n.º 13
0
 public bool HasRowsAfter(Model.InvoiceZG e)
 {
     return(sqlmapper.QueryForObject <bool>("InvoiceZG.has_rows_after", e));
 }
Ejemplo n.º 14
0
 public bool HasRowsBefore(Model.InvoiceZG e)
 {
     return(sqlmapper.QueryForObject <bool>("InvoiceZG.has_rows_before", e));
 }
Ejemplo n.º 15
0
 public void Update(Model.InvoiceZG e)
 {
     this.Update <Model.InvoiceZG>(e);
 }
Ejemplo n.º 16
0
 public void Insert(Model.InvoiceZG e)
 {
     this.Insert <Model.InvoiceZG>(e);
 }
Ejemplo n.º 17
0
 public bool HasRowsBefore(Model.InvoiceZG e)
 {
     return(accessor.HasRowsBefore(e));
 }
Ejemplo n.º 18
0
 public bool HasRowsAfter(Model.InvoiceZG e)
 {
     return(accessor.HasRowsAfter(e));
 }
Ejemplo n.º 19
0
 public Model.InvoiceZG GetPrev(Model.InvoiceZG e)
 {
     return(accessor.GetPrev(e));
 }
Ejemplo n.º 20
0
 public Model.InvoiceZG GetNext(Model.InvoiceZG e)
 {
     return(sqlmapper.QueryForObject <Model.InvoiceZG>("InvoiceZG.get_next", e));
 }
Ejemplo n.º 21
0
 public Model.InvoiceZG GetNext(Model.InvoiceZG e)
 {
     return(accessor.GetNext(e));
 }
Ejemplo n.º 22
0
 public Model.InvoiceZG GetPrev(Model.InvoiceZG e)
 {
     return(sqlmapper.QueryForObject <Model.InvoiceZG>("InvoiceZG.get_prev", e));
 }
Ejemplo n.º 23
0
 protected override void MoveFirst()
 {
     this._invoiceZG = this._invoiceZGManager.GetFirst();
 }