protected override void AddNew() { this._PCIncomingCheck = new Book.Model.PCIncomingCheck(); this._PCIncomingCheck.PCIncomingCheckId = this.manager.GetId(); this._PCIncomingCheck.CheckDate = DateTime.Now; this._PCIncomingCheck.Employee = BL.V.ActiveOperator.Employee; this.action = "insert"; }
protected override void MovePrev() { Model.PCIncomingCheck p = this.manager.GetPrev(this._PCIncomingCheck); if (p == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this._PCIncomingCheck = p; }
public Model.PCIncomingCheck GetDetail(string PCIncomingCheckId) { Model.PCIncomingCheck model = this.Get(PCIncomingCheckId); if (model != null) { model.Detail = accessorDetail.SelectByPrimaryId(PCIncomingCheckId); } return(model); }
public EditForm(string PCIncomingCheckId) : this() { this._PCIncomingCheck = this.manager.Get(PCIncomingCheckId); this.action = "view"; if (this.action == "view") { LastFlag = 1; } }
public EditForm(Model.PCIncomingCheck model, string action) : this() { if (model == null) { throw new ArithmeticException("invoiceid"); } this._PCIncomingCheck = model; this.action = action; if (this.action == "view") { LastFlag = 1; } }
private void TiGuiExists(Model.PCIncomingCheck model) { if (this.ExistsPrimary(model.PCIncomingCheckId)) { //设置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.PCIncomingCheckId = this.GetId(model.InsertTime.Value); TiGuiExists(model); } }
protected override void Delete() { if (this._PCIncomingCheck == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { Model.PCIncomingCheck model = this.manager.GetNext(this._PCIncomingCheck); this.manager.Delete(this._PCIncomingCheck.PCIncomingCheckId); if (model == null) { this._PCIncomingCheck = this.manager.GetLast(); } else { this._PCIncomingCheck = model; } } }
/// <summary> /// Insert a PCIncomingCheck. /// </summary> public void Insert(Model.PCIncomingCheck pCIncomingCheck) { // // todo:add other logic here // try { BL.V.BeginTransaction(); pCIncomingCheck.InsertTime = DateTime.Now; pCIncomingCheck.UpdateTime = DateTime.Now; this.Validate(pCIncomingCheck); this.TiGuiExists(pCIncomingCheck); accessor.Insert(pCIncomingCheck); //设置KEY值 string invoiceKind = this.GetInvoiceKind().ToLower(); string sequencekey_y = string.Format("{0}-y-{1}", invoiceKind, pCIncomingCheck.InsertTime.Value.Year); string sequencekey_m = string.Format("{0}-m-{1}-{2}", invoiceKind, pCIncomingCheck.InsertTime.Value.Year, pCIncomingCheck.InsertTime.Value.Month); string sequencekey_d = string.Format("{0}-d-{1}", invoiceKind, pCIncomingCheck.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 pCIncomingCheck.Detail) { accessorDetail.Insert(item); } BL.V.CommitTransaction(); } catch { BL.V.RollbackTransaction(); throw; } }
public override void Refresh() { if (this._PCIncomingCheck == null) { this.AddNew(); } else { if (this.action == "view") { this._PCIncomingCheck = this.manager.GetDetail(this._PCIncomingCheck.PCIncomingCheckId); } } this.txt_Id.Text = this._PCIncomingCheck.PCIncomingCheckId; this.date_PurchaseDate.EditValue = this._PCIncomingCheck.PurchaseDate; this.date_IncomingDate.EditValue = this._PCIncomingCheck.IncomingDate; this.date_CheckDate.EditValue = this._PCIncomingCheck.CheckDate; this.txt_materialCategory.Text = this._PCIncomingCheck.MaterialCategory; this.nccEmployee.EditValue = this._PCIncomingCheck.Employee; this.txt_Pihao.Text = this._PCIncomingCheck.Note; this.bindingSourceDetail.DataSource = this._PCIncomingCheck.Detail; base.Refresh(); switch (this.action) { case "view": this.gridView1.OptionsBehavior.Editable = false; break; default: this.gridView1.OptionsBehavior.Editable = true; break; } this.txt_Id.Properties.ReadOnly = true; }
public bool HasRowsAfter(Model.PCIncomingCheck e) { return(sqlmapper.QueryForObject <bool>("PCIncomingCheck.has_rows_after", e)); }
public bool HasRowsBefore(Model.PCIncomingCheck e) { return(sqlmapper.QueryForObject <bool>("PCIncomingCheck.has_rows_before", e)); }
public void Update(Model.PCIncomingCheck e) { this.Update <Model.PCIncomingCheck>(e); }
public void Insert(Model.PCIncomingCheck e) { this.Insert <Model.PCIncomingCheck>(e); }
public Model.PCIncomingCheck GetNext(Model.PCIncomingCheck e) { return(accessor.GetNext(e)); }
public Model.PCIncomingCheck GetPrev(Model.PCIncomingCheck e) { return(accessor.GetPrev(e)); }
public bool HasRowsAfter(Model.PCIncomingCheck e) { return(accessor.HasRowsAfter(e)); }
public Model.PCIncomingCheck GetNext(Model.PCIncomingCheck e) { return(sqlmapper.QueryForObject <Model.PCIncomingCheck>("PCIncomingCheck.get_next", e)); }
protected override void MoveFirst() { this._PCIncomingCheck = this.manager.GetFirst(); }
public Model.PCIncomingCheck GetPrev(Model.PCIncomingCheck e) { return(sqlmapper.QueryForObject <Model.PCIncomingCheck>("PCIncomingCheck.get_prev", e)); }
public bool HasRowsBefore(Model.PCIncomingCheck e) { return(accessor.HasRowsBefore(e)); }