protected override void MoveLast() { if (this.AtProfitLoss == null) { this.AtProfitLoss = this.AtProfitLossManager.GetLast(); } }
public bool ExistsExcept(Model.AtProfitLoss e) { Hashtable paras = new Hashtable(); paras.Add("newId", e.Id); paras.Add("oldId", Get(e.ProfitLossId) == null?null:Get(e.ProfitLossId).Id); return(sqlmapper.QueryForObject <bool>("AtProfitLoss.existsexcept", paras)); }
protected override void MoveNext() { Model.AtProfitLoss AtProfitLoss = this.AtProfitLossManager.GetNext(this.AtProfitLoss); if (AtProfitLoss == null) { throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows); } this.AtProfitLoss = AtProfitLoss; }
/// <summary> /// Update a AtProfitLoss. /// </summary> public void Update(Model.AtProfitLoss atProfitLoss) { // // todo: add other logic here. // Validate(atProfitLoss); atProfitLoss.UpdateTime = DateTime.Now; accessor.Update(atProfitLoss); }
/// <summary> /// Insert a AtProfitLoss. /// </summary> public void Insert(Model.AtProfitLoss atProfitLoss) { // // todo:add other logic here // Validate(atProfitLoss); atProfitLoss.ProfitLossId = Guid.NewGuid().ToString(); atProfitLoss.InsertTime = DateTime.Now; accessor.Insert(atProfitLoss); }
private void Validate(Model.AtProfitLoss atProfitLoss) { if (string.IsNullOrEmpty(atProfitLoss.ProfitLossCategory)) { throw new Helper.RequireValueException(Model.AtProfitLoss.PRO_ProfitLossCategory); } if (string.IsNullOrEmpty(atProfitLoss.CategoriesName)) { throw new Helper.RequireValueException(Model.AtProfitLoss.PRO_CategoriesName); } if (string.IsNullOrEmpty(atProfitLoss.SubjectId)) { throw new Helper.RequireValueException(Model.AtProfitLoss.PRO_SubjectId); } }
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.AtProfitLoss productEpiboly = this.bindingSource1.Current as Model.AtProfitLoss; if (productEpiboly != null) { this.AtProfitLoss = productEpiboly; this.action = "view"; this.Refresh(); } } }
protected override void Delete() { if (this.AtProfitLoss == null) { return; } if (MessageBox.Show(Properties.Resources.ConfirmToDelete, this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) != DialogResult.OK) { return; } this.AtProfitLossManager.Delete(this.AtProfitLoss.ProfitLossId); this.AtProfitLoss = this.AtProfitLossManager.GetNext(this.AtProfitLoss); if (this.AtProfitLoss == null) { this.AtProfitLoss = this.AtProfitLossManager.GetLast(); } }
protected override void AddNew() { this.AtProfitLoss = new Model.AtProfitLoss(); //this.AtProfitLoss.CustomInspectionRuleId = this.AtProfitLossManager.GetId(); }
public Model.AtProfitLoss GetPrev(Model.AtProfitLoss e) { return(sqlmapper.QueryForObject <Model.AtProfitLoss>("AtProfitLoss.get_prev", e)); }
public Model.AtProfitLoss GetNext(Model.AtProfitLoss e) { return(sqlmapper.QueryForObject <Model.AtProfitLoss>("AtProfitLoss.get_next", e)); }
public bool HasRowsBefore(Model.AtProfitLoss e) { return(accessor.HasRowsBefore(e)); }
public EditForm(Model.AtProfitLoss AtProfitLoss, string action) : this() { this.AtProfitLoss = AtProfitLoss; this.action = action; }
public Model.AtProfitLoss GetNext(Model.AtProfitLoss e) { return(accessor.GetNext(e)); }
public Model.AtProfitLoss GetPrev(Model.AtProfitLoss e) { return(accessor.GetPrev(e)); }
public bool HasRowsAfter(Model.AtProfitLoss e) { return(accessor.HasRowsAfter(e)); }
protected override void MoveFirst() { this.AtProfitLoss = this.AtProfitLossManager.GetFirst(); }
public void Insert(Model.AtProfitLoss e) { this.Insert <Model.AtProfitLoss>(e); }
public override void Refresh() { if (this.AtProfitLoss == null) { this.AtProfitLoss = new Book.Model.AtProfitLoss(); this.action = "insert"; } this.bindingSource1.DataSource = AtProfitLossManager.Select(); this.textEditCategory.Text = this.AtProfitLoss.ProfitLossCategory; this.lookUpEdit1.EditValue = this.AtProfitLoss.CategoriesName; this.newChooseContorl1.EditValue = this.AtProfitLoss.Subject; this.spinEditThisMoney.EditValue = this.AtProfitLoss.ThisMoney; this.spinEditIsMoney.EditValue = this.AtProfitLoss.IsMoney; this.spinEditRatio.EditValue = this.AtProfitLoss.Ratio; if (global::Helper.DateTimeParse.DateTimeEquls(this.AtProfitLoss.ProfitLossDate, global::Helper.DateTimeParse.NullDate)) { this.dateEditDate.EditValue = null; } else { this.dateEditDate.EditValue = this.AtProfitLoss.ProfitLossDate; } switch (this.action) { case "insert": this.textEditCategory.Properties.ReadOnly = false; this.lookUpEdit1.Properties.ReadOnly = false; this.newChooseContorl1.ShowButton = true; this.newChooseContorl1.ButtonReadOnly = false; this.spinEditThisMoney.Properties.ReadOnly = false; this.spinEditIsMoney.Properties.ReadOnly = false; this.spinEditRatio.Properties.ReadOnly = false; this.dateEditDate.Properties.ReadOnly = false; this.dateEditDate.Properties.Buttons[0].Visible = true; break; case "update": this.textEditCategory.Properties.ReadOnly = false; this.lookUpEdit1.Properties.ReadOnly = false; this.newChooseContorl1.ShowButton = true; this.newChooseContorl1.ButtonReadOnly = false; this.spinEditThisMoney.Properties.ReadOnly = false; this.spinEditIsMoney.Properties.ReadOnly = false; this.spinEditRatio.Properties.ReadOnly = false; this.dateEditDate.Properties.ReadOnly = false; this.dateEditDate.Properties.Buttons[0].Visible = true; break; case "view": this.textEditCategory.Properties.ReadOnly = true; this.lookUpEdit1.Properties.ReadOnly = true; this.newChooseContorl1.ShowButton = false; this.newChooseContorl1.ButtonReadOnly = true; this.spinEditThisMoney.Properties.ReadOnly = true; this.spinEditIsMoney.Properties.ReadOnly = true; this.spinEditRatio.Properties.ReadOnly = true; this.dateEditDate.Properties.ReadOnly = true; this.dateEditDate.Properties.Buttons[0].Visible = false; break; default: break; } base.Refresh(); }
public void Update(Model.AtProfitLoss e) { this.Update <Model.AtProfitLoss>(e); }
public EditForm(Model.AtProfitLoss AtProfitLoss) : this() { this.AtProfitLoss = AtProfitLoss; this.action = "update"; }
public bool HasRowsBefore(Model.AtProfitLoss e) { return(sqlmapper.QueryForObject <bool>("AtProfitLoss.has_rows_before", e)); }
public bool HasRowsAfter(Model.AtProfitLoss e) { return(sqlmapper.QueryForObject <bool>("AtProfitLoss.has_rows_after", e)); }
public bool ExistsExcept(Model.AtProfitLoss e) { return(accessor.ExistsExcept(e)); }