public void Insert(Model.AtAccountSubject atAccountSubject) { Validate(atAccountSubject); atAccountSubject.SubjectId = Guid.NewGuid().ToString(); try { atAccountSubject.InsertTime = DateTime.Now; BL.V.BeginTransaction(); string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, atAccountSubject.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, atAccountSubject.InsertTime.Value.Year, atAccountSubject.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, atAccountSubject.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(atAccountSubject); BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
protected override void Delete() { if (this.AtAccountSubject == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } try { this.AtAccountSubjectManager.Delete(this.AtAccountSubject.SubjectId); this.AtAccountSubject = this.AtAccountSubjectManager.GetNext(this.AtAccountSubject); if (this.AtAccountSubject == null) { this.AtAccountSubject = this.AtAccountSubjectManager.GetLast(); } } catch { throw new Exception(""); } return; }
public bool ExistsExcept(Model.AtAccountSubject e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.SubjectId) == null?null:Get(e.SubjectId).Id); return(sqlmapper.QueryForObject <bool>("AtAccountSubject.existsexcept", paras)); }
public override void Refresh() { if (this.AtAccountSubject == null) { this.AtAccountSubject = new Book.Model.AtAccountSubject(); this.action = "insert"; } this.bindingSource1.DataSource = this.AtAccountSubjectManager.Select(); this.newChooseAccountingCategoryId.EditValue = this.AtAccountSubject.AccountingCategory; this.textEditSubjectId.Text = this.AtAccountSubject.Id; this.textEditSubjectName.Text = this.AtAccountSubject.SubjectName; this.textEditCommonSummary.Text = this.AtAccountSubject.CommonSummary; this.spinEditTheBalance.EditValue = this.AtAccountSubject.TheBalance; if (this.AtAccountSubject.TheLending == "借") { this.radioGroupTheLending.SelectedIndex = 0; } else { this.radioGroupTheLending.SelectedIndex = 1; } switch (this.action) { case "insert": this.newChooseAccountingCategoryId.ShowButton = true; this.newChooseAccountingCategoryId.ButtonReadOnly = false; this.textEditSubjectId.Properties.ReadOnly = false; this.textEditSubjectName.Properties.ReadOnly = false; this.textEditCommonSummary.Properties.ReadOnly = false; this.spinEditTheBalance.Properties.ReadOnly = false; this.radioGroupTheLending.Properties.ReadOnly = false; break; case "update": this.newChooseAccountingCategoryId.ShowButton = true; this.newChooseAccountingCategoryId.ButtonReadOnly = false; this.textEditSubjectId.Properties.ReadOnly = false; this.textEditSubjectName.Properties.ReadOnly = false; this.textEditCommonSummary.Properties.ReadOnly = false; this.spinEditTheBalance.Properties.ReadOnly = false; this.radioGroupTheLending.Properties.ReadOnly = false; break; case "view": this.newChooseAccountingCategoryId.ShowButton = false; this.newChooseAccountingCategoryId.ButtonReadOnly = true; this.textEditSubjectId.Properties.ReadOnly = true; this.textEditSubjectName.Properties.ReadOnly = true; this.textEditCommonSummary.Properties.ReadOnly = true; this.spinEditTheBalance.Properties.ReadOnly = true; this.radioGroupTheLending.Properties.ReadOnly = true; break; default: break; } base.Refresh(); }
protected override void MoveNext() { Model.AtAccountSubject AtAccountSubject = this.AtAccountSubjectManager.GetNext(this.AtAccountSubject); if (AtAccountSubject == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.AtAccountSubject = AtAccountSubject; }
/// <summary> /// /// </summary> /// <param name="item"></param> public void MyClick(ref ChooseItem item) { ChooseAccountSubjectForm f = new ChooseAccountSubjectForm(); if (f.ShowDialog() == System.Windows.Forms.DialogResult.OK) { Model.AtAccountSubject AtAccountSubject = f.SelectedItem as Model.AtAccountSubject; item = new ChooseItem(AtAccountSubject, AtAccountSubject.Id, AtAccountSubject.SubjectName); } }
private void xrSubreport1_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e) { XRGeneralAccountDetail subreport = this.xrSubreport1.ReportSource as XRGeneralAccountDetail; Model.AtAccountSubject ataccountsubject = this.GetCurrentRow() as Model.AtAccountSubject; if (ataccountsubject != null) { subreport.ataccountsubject = ataccountsubject; this._calcSubjects.Add(subreport.ataccountsubject); } }
private void Validate(Model.AtAccountSubject atAccountSubject) { if (string.IsNullOrEmpty(atAccountSubject.Id)) { throw new Helper.RequireValueException(Model.AtAccountSubject.PRO_Id); } if (string.IsNullOrEmpty(atAccountSubject.SubjectName)) { throw new Helper.RequireValueException(Model.AtAccountSubject.PRO_SubjectName); } if (string.IsNullOrEmpty(atAccountSubject.AccountingCategoryId)) { throw new Helper.RequireValueException(Model.AtAccountSubject.PRO_AccountingCategoryId); } }
public void MyLeave(ref ChooseItem item) { BL.AtAccountSubjectManager manager = new Book.BL.AtAccountSubjectManager(); Model.AtAccountSubject AtAccountSubject = manager.GetById(item.ButtonText); if (AtAccountSubject != null) { item.EditValue = AtAccountSubject; item.LabelText = AtAccountSubject.SubjectName; item.ButtonText = AtAccountSubject.Id; } else { item.ErrorMessage = "物料類型錯誤"; } }
public decimal GET_ZFLZ_Yue(Model.AtAccountSubject subject, DateTime startdate) { Hashtable ht = new Hashtable(); ht.Add("subjectid", subject == null ? null : subject.SubjectId); ht.Add("startdate", startdate); if (subject != null && subject.Id == "1101000") { return(sqlmapper.QueryForObject <decimal>("AtSummonDetail.GET_ZFLZ_YueXianJin", ht)); } else { return(sqlmapper.QueryForObject <decimal>("AtSummonDetail.GET_ZFLZ_Yue", ht)); } }
private void gridView1_Click(object sender, EventArgs e) { GridView view = sender as GridView; GridHitInfo hitInfo = view.CalcHitInfo(view.GridControl.PointToClient(Cursor.Position)); if (hitInfo.InRow && !view.IsGroupRow(hitInfo.RowHandle)) { Model.AtAccountSubject productEpiboly = this.bindingSource1.Current as Model.AtAccountSubject; if (productEpiboly != null) { this.AtAccountSubject = productEpiboly; this.action = "view"; this.Refresh(); } } }
public bool ExistsExcept(Model.AtAccountSubject e) { return(accessor.ExistsExcept(e)); }
protected override void MoveLast() { this.AtAccountSubject = this.AtAccountSubjectManager.GetLast(); }
public bool HasRowsBefore(Model.AtAccountSubject e) { return(accessor.HasRowsBefore(e)); }
public override void Refresh() { if (this.AtAccountSubject == null) { this.AddNew(); this.action = "insert"; } else if (this.AtAccountSubject != null) { this.AtAccountSubject = this.AtAccountSubjectManager.Get(this.AtAccountSubject.SubjectId); } //排序 //this.bindingSource1.DataSource = this.MXsrot(this.AtAccountSubjectManager.Select()); this.bindingSource1.DataSource = this.AtAccountSubjectManager.Select(); this.newChooseAccountingCategoryId.EditValue = this.AtAccountSubject.AccountingCategory; this.textEditSubjectId.Text = this.AtAccountSubject.Id; this.textEditSubjectName.Text = this.AtAccountSubject.SubjectName; this.textEditCommonSummary.Text = this.AtAccountSubject.CommonSummary; this.spinEditTheBalance.EditValue = this.AtAccountSubject.TheBalance; this.nccAtAccountSubject.EditValue = this.AtAccountSubjectManager.Get(this.AtAccountSubject.UnderSubject); this.comboBoxEditCash.EditValue = this.AtAccountSubject.IsCash; this.ncc_Bank.EditValue = this.AtAccountSubject.Bank; if (this.AtAccountSubject.TheLending == "借") { this.radioGroupTheLending.SelectedIndex = 0; } else { this.radioGroupTheLending.SelectedIndex = 1; } switch (this.action) { case "insert": this.newChooseAccountingCategoryId.ShowButton = true; this.newChooseAccountingCategoryId.ButtonReadOnly = false; this.textEditSubjectId.Properties.ReadOnly = false; this.textEditSubjectName.Properties.ReadOnly = false; this.textEditCommonSummary.Properties.ReadOnly = false; this.spinEditTheBalance.Properties.ReadOnly = false; this.radioGroupTheLending.Properties.ReadOnly = false; break; case "update": this.newChooseAccountingCategoryId.ShowButton = true; this.newChooseAccountingCategoryId.ButtonReadOnly = false; this.textEditSubjectId.Properties.ReadOnly = false; this.textEditSubjectName.Properties.ReadOnly = false; this.textEditCommonSummary.Properties.ReadOnly = false; this.spinEditTheBalance.Properties.ReadOnly = false; this.radioGroupTheLending.Properties.ReadOnly = false; break; case "view": this.newChooseAccountingCategoryId.ShowButton = false; this.newChooseAccountingCategoryId.ButtonReadOnly = true; this.textEditSubjectId.Properties.ReadOnly = true; this.textEditSubjectName.Properties.ReadOnly = true; this.textEditCommonSummary.Properties.ReadOnly = true; this.spinEditTheBalance.Properties.ReadOnly = true; this.radioGroupTheLending.Properties.ReadOnly = true; break; default: break; } base.Refresh(); }
public decimal GET_ZFLZ_Yue(Model.AtAccountSubject subject, DateTime startdate) { return(accessor.GET_ZFLZ_Yue(subject, startdate)); }
public Model.AtAccountSubject GetPrev(Model.AtAccountSubject e) { return(accessor.GetPrev(e)); }
public bool HasRowsAfter(Model.AtAccountSubject e) { return(accessor.HasRowsAfter(e)); }
public Model.AtAccountSubject GetPrev(Model.AtAccountSubject e) { return(sqlmapper.QueryForObject <Model.AtAccountSubject>("AtAccountSubject.get_prev", e)); }
public bool HasRowsAfter(Model.AtAccountSubject e) { return(sqlmapper.QueryForObject <bool>("AtAccountSubject.has_rows_after", e)); }
public bool HasRowsBefore(Model.AtAccountSubject e) { return(sqlmapper.QueryForObject <bool>("AtAccountSubject.has_rows_before", e)); }
public void Update(Model.AtAccountSubject e) { this.Update <Model.AtAccountSubject>(e); }
public void Insert(Model.AtAccountSubject e) { this.Insert <Model.AtAccountSubject>(e); }
protected override void AddNew() { this.AtAccountSubject = new Model.AtAccountSubject(); this.AtAccountSubject.Id = this.AtAccountSubjectManager.GetId(); }
public void Update(Model.AtAccountSubject atAccountSubject) { Validate(atAccountSubject); atAccountSubject.UpdateTime = DateTime.Now; accessor.Update(atAccountSubject); }
public Model.AtAccountSubject GetNext(Model.AtAccountSubject e) { return(sqlmapper.QueryForObject <Model.AtAccountSubject>("AtAccountSubject.get_next", e)); }
public Model.AtAccountSubject GetNext(Model.AtAccountSubject e) { return(accessor.GetNext(e)); }