/// <summary> /// 删除 /// </summary> protected override void Delete() { if (this.AtDepreciationDetail == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK) { return; } try { this.AtDepreciationDetailManager.Delete(this.AtDepreciationDetail.DepreciationId); this.AtDepreciationDetail = this.AtDepreciationDetailManager.GetNext(this.AtDepreciationDetail); if (this.AtDepreciationDetail == null) { this.AtDepreciationDetail = this.AtDepreciationDetailManager.GetLast(); } } catch { throw new Exception(""); } return; }
private void Validate(Model.AtDepreciationDetail atDepreciationDetail) { if (string.IsNullOrEmpty(atDepreciationDetail.PropertyId)) { throw new Helper.RequireValueException(Model.AtDepreciationDetail.PRO_PropertyId); } }
public bool ExistsExcept(Model.AtDepreciationDetail e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.DepreciationId) == null?null:Get(e.DepreciationId).Id); return(sqlmapper.QueryForObject <bool>("AtDepreciationDetail.existsexcept", paras)); }
/// <summary> /// Update a AtDepreciationDetail. /// </summary> public void Update(Model.AtDepreciationDetail atDepreciationDetail) { // // todo: add other logic here. // Validate(atDepreciationDetail); atDepreciationDetail.UpdateTime = DateTime.Now; accessor.Update(atDepreciationDetail); }
/// <summary> /// Insert a AtDepreciationDetail. /// </summary> public void Insert(Model.AtDepreciationDetail atDepreciationDetail) { // // todo:add other logic here // Validate(atDepreciationDetail); atDepreciationDetail.InsertTime = DateTime.Now; atDepreciationDetail.DepreciationId = Guid.NewGuid().ToString(); accessor.Insert(atDepreciationDetail); }
protected override void MoveNext() { Model.AtDepreciationDetail AtDepreciationDetail = this.AtDepreciationDetailManager.GetNext(this.AtDepreciationDetail); if (AtDepreciationDetail == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.AtDepreciationDetail = AtDepreciationDetail; }
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.AtDepreciationDetail productEpiboly = this.bindingSource2.Current as Model.AtDepreciationDetail; if (productEpiboly != null) { this.AtDepreciationDetail = productEpiboly; this.action = "view"; this.Refresh(); } } }
protected override void AddNew() { this.AtDepreciationDetail = new Model.AtDepreciationDetail(); }
public Model.AtDepreciationDetail GetPrev(Model.AtDepreciationDetail e) { return(sqlmapper.QueryForObject <Model.AtDepreciationDetail>("AtDepreciationDetail.get_prev", e)); }
public bool HasRowsAfter(Model.AtDepreciationDetail e) { return(sqlmapper.QueryForObject <bool>("AtDepreciationDetail.has_rows_after", e)); }
public bool HasRowsBefore(Model.AtDepreciationDetail e) { return(sqlmapper.QueryForObject <bool>("AtDepreciationDetail.has_rows_before", e)); }
public void Update(Model.AtDepreciationDetail e) { this.Update <Model.AtDepreciationDetail>(e); }
public void Insert(Model.AtDepreciationDetail e) { this.Insert <Model.AtDepreciationDetail>(e); }
public bool HasRowsAfter(Model.AtDepreciationDetail e) { return(accessor.HasRowsAfter(e)); }
public bool HasRowsBefore(Model.AtDepreciationDetail e) { return(accessor.HasRowsBefore(e)); }
public Model.AtDepreciationDetail GetNext(Model.AtDepreciationDetail e) { return(accessor.GetNext(e)); }
protected override void MoveLast() { this.AtDepreciationDetail = this.AtDepreciationDetailManager.GetLast(); }
public override void Refresh() { if (this.AtDepreciationDetail == null) { this.AtDepreciationDetail = new Book.Model.AtDepreciationDetail(); this.action = "insert"; } this.bindingSource2.DataSource = this.AtDepreciationDetailManager.Select(); if (global::Helper.DateTimeParse.DateTimeEquls(this.AtDepreciationDetail.DepreciationDate, global::Helper.DateTimeParse.NullDate)) { this.dateEditDepreciationDate.EditValue = null; } else { this.dateEditDepreciationDate.EditValue = this.AtDepreciationDetail.DepreciationDate; } this.newChooseContorlPropertyId.EditValue = AtDepreciationDetail.Property; this.spinEditDepreciationMoney.EditValue = this.AtDepreciationDetail.DepreciationMoney; this.lookUpEditDepreciationSubject.EditValue = this.AtDepreciationDetail.DepreciationSubject; this.lookUpEditCostSubject.EditValue = this.AtDepreciationDetail.CostSubject; this.memoEditMark.Text = this.AtDepreciationDetail.Mark; switch (this.action) { case "insert": this.dateEditDepreciationDate.Properties.ReadOnly = false; this.dateEditDepreciationDate.Properties.Buttons[0].Visible = true; this.spinEditDepreciationMoney.Properties.ReadOnly = false; this.lookUpEditDepreciationSubject.Properties.ReadOnly = false; this.lookUpEditCostSubject.Properties.ReadOnly = false; this.memoEditMark.Properties.ReadOnly = false; this.newChooseContorlPropertyId.ShowButton = true; this.newChooseContorlPropertyId.ButtonReadOnly = false; break; case "update": this.dateEditDepreciationDate.Properties.ReadOnly = false; this.dateEditDepreciationDate.Properties.Buttons[0].Visible = true; this.spinEditDepreciationMoney.Properties.ReadOnly = false; this.lookUpEditDepreciationSubject.Properties.ReadOnly = false; this.lookUpEditCostSubject.Properties.ReadOnly = false; this.memoEditMark.Properties.ReadOnly = false; this.newChooseContorlPropertyId.ShowButton = true; this.newChooseContorlPropertyId.ButtonReadOnly = false; break; case "view": this.dateEditDepreciationDate.Properties.ReadOnly = true; this.dateEditDepreciationDate.Properties.Buttons[0].Visible = false; this.spinEditDepreciationMoney.Properties.ReadOnly = true; this.lookUpEditDepreciationSubject.Properties.ReadOnly = true; this.lookUpEditCostSubject.Properties.ReadOnly = true; this.memoEditMark.Properties.ReadOnly = true; this.newChooseContorlPropertyId.ShowButton = false; this.newChooseContorlPropertyId.ButtonReadOnly = true; break; default: break; } base.Refresh(); }
public bool ExistsExcept(Model.AtDepreciationDetail e) { return(accessor.ExistsExcept(e)); }