示例#1
0
 protected override void MoveLast()
 {
     if (this.AtProfitLoss == null)
     {
         this.AtProfitLoss = this.AtProfitLossManager.GetLast();
     }
 }
示例#2
0
        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));
        }
示例#3
0
 protected override void MoveNext()
 {
     Model.AtProfitLoss AtProfitLoss = this.AtProfitLossManager.GetNext(this.AtProfitLoss);
     if (AtProfitLoss == null)
     {
         throw new InvalidOperationException(Properties.Resources.ErrorNoMoreRows);
     }
     this.AtProfitLoss = AtProfitLoss;
 }
示例#4
0
 /// <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);
 }
示例#5
0
 /// <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);
 }
示例#6
0
 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);
     }
 }
示例#7
0
        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();
                }
            }
        }
示例#8
0
 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();
     }
 }
示例#9
0
 protected override void AddNew()
 {
     this.AtProfitLoss = new Model.AtProfitLoss();
     //this.AtProfitLoss.CustomInspectionRuleId = this.AtProfitLossManager.GetId();
 }
示例#10
0
 public Model.AtProfitLoss GetPrev(Model.AtProfitLoss e)
 {
     return(sqlmapper.QueryForObject <Model.AtProfitLoss>("AtProfitLoss.get_prev", e));
 }
示例#11
0
 public Model.AtProfitLoss GetNext(Model.AtProfitLoss e)
 {
     return(sqlmapper.QueryForObject <Model.AtProfitLoss>("AtProfitLoss.get_next", e));
 }
示例#12
0
 public bool HasRowsBefore(Model.AtProfitLoss e)
 {
     return(accessor.HasRowsBefore(e));
 }
示例#13
0
 public EditForm(Model.AtProfitLoss AtProfitLoss, string action)
     : this()
 {
     this.AtProfitLoss = AtProfitLoss;
     this.action       = action;
 }
示例#14
0
 public Model.AtProfitLoss GetNext(Model.AtProfitLoss e)
 {
     return(accessor.GetNext(e));
 }
示例#15
0
 public Model.AtProfitLoss GetPrev(Model.AtProfitLoss e)
 {
     return(accessor.GetPrev(e));
 }
示例#16
0
 public bool HasRowsAfter(Model.AtProfitLoss e)
 {
     return(accessor.HasRowsAfter(e));
 }
示例#17
0
 protected override void MoveFirst()
 {
     this.AtProfitLoss = this.AtProfitLossManager.GetFirst();
 }
示例#18
0
 public void Insert(Model.AtProfitLoss e)
 {
     this.Insert <Model.AtProfitLoss>(e);
 }
示例#19
0
        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();
        }
示例#20
0
 public void Update(Model.AtProfitLoss e)
 {
     this.Update <Model.AtProfitLoss>(e);
 }
示例#21
0
 public EditForm(Model.AtProfitLoss AtProfitLoss)
     : this()
 {
     this.AtProfitLoss = AtProfitLoss;
     this.action       = "update";
 }
示例#22
0
 public bool HasRowsBefore(Model.AtProfitLoss e)
 {
     return(sqlmapper.QueryForObject <bool>("AtProfitLoss.has_rows_before", e));
 }
示例#23
0
 public bool HasRowsAfter(Model.AtProfitLoss e)
 {
     return(sqlmapper.QueryForObject <bool>("AtProfitLoss.has_rows_after", e));
 }
示例#24
0
 public bool ExistsExcept(Model.AtProfitLoss e)
 {
     return(accessor.ExistsExcept(e));
 }