Ejemplo n.º 1
0
        protected override void OnLoad(EventArgs e)
        {
            Expend = new Expend_BLL();
            var entity = Expend.Get_Entity(int.Parse(Id));

            entity.ExpendDate = DateTime.Now;
            expend_Controls1.Expend_Entity = entity;
            base.OnLoad(e);
        }
Ejemplo n.º 2
0
        protected override void OnLoad(EventArgs e)
        {
            Expend = new Expend_BLL();
            var entity = Expend.Get_Entity(int.Parse(Id));

            Expend.OriginalInfo(entity);
            expend_Controls1.Expend_Entity = entity;
            base.OnLoad(e);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 总金额
 /// </summary>
 private void Total_Amount()
 {
     if (Expend == null)
     {
         Expend = new Expend_BLL();
     }
     expend_Manage_Controls1.Total_Amount = Expend.Get_Total_Amount(expend_Manage_Controls1.StartDate,
                                                                    expend_Manage_Controls1.EndDate, expend_Manage_Controls1.ExpendType, expend_Manage_Controls1.ItemName,
                                                                    expend_Manage_Controls1.Amount_1, expend_Manage_Controls1.Amount_2);
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 绑定数据集合
        /// </summary>
        private void BindingDataGridView(int pageIndex)
        {
            int pageCount;

            if (Expend == null)
            {
                Expend = new Expend_BLL();
            }

            expend_Manage_Controls1.Data = Expend.PagingData(pageIndex, out pageCount, pageSize, expend_Manage_Controls1.StartDate,
                                                             expend_Manage_Controls1.EndDate, expend_Manage_Controls1.ExpendType, expend_Manage_Controls1.ItemName,
                                                             expend_Manage_Controls1.Amount_1, expend_Manage_Controls1.Amount_2);

            //分页
            paging_Control1.Load_Paging_Info(pageIndex, pageCount, pageSize);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="id">主键</param>
        private void DataGridView_Delete_Button(string id)
        {
            if (MessageBox.Show("请确定要删除吗?", "删除提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.Yes)
            {
                if (Expend == null)
                {
                    Expend = new Expend_BLL();
                }

                if (Expend.Delete(int.Parse(id)) > -1)
                {
                    BindingDataGridView(1);
                    Total_Amount();
                }
            }
        }
Ejemplo n.º 6
0
        protected override void OnLoad(EventArgs e)
        {
            ParameterValue_BLL parameterValue      = new ParameterValue_BLL();
            DataTable          parameterValue_Data = parameterValue.Get_Data("支出类型");

            expend_Year_Controls1.ParameterValue_Data  = parameterValue_Data;
            expend_Month_Controls1.ParameterValue_Data = parameterValue_Data;
            expend_Day_Controls1.ParameterValue_Data   = parameterValue_Data;
            expend_Year_Controls1.QueryClick          += QueryClick;
            expend_Month_Controls1.QueryClick         += Month_QueryClick;
            expend_Day_Controls1.QueryClick           += Day_QueryClick;
            ExpendBLL = new Expend_BLL();

            DoLoad_Year();
            DoLoad_Month();
            DoLoad_Day();
            base.OnLoad(e);
        }
Ejemplo n.º 7
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (Expend == null)
            {
                Expend = new Expend_BLL();
            }
            var entity = expend_Controls1.Expend_Entity;

            if (Expend.RepeatVerify_Add(entity))
            {
                if (Expend.Add(entity) > -1)
                {
                    expend_Controls1.Dispose();
                    this.DialogResult = MessageBox.Show("添加支出成功!", "支出添加提示", MessageBoxButtons.OK); //DialogResult.OK;
                }
            }
            else
            {
                MessageBox.Show(Expend.Messages, "支出添加提示");
            }
        }