Exemple #1
0
 /// <summary>
 /// 获取列表
 /// </summary>
 /// <param name="year">年份数字</param>
 /// <param name="month">月份数字</param>
 /// <param name="departmentID"></param>
 /// <returns>列表</returns>
 public IList<CommonFeeInfo> GetListAddBlank(string year, string month, string departmentID)
 {
     IList<CommonFeeInfo> list = GetList(year, month, departmentID);
     CommonFeeInfo cInfo = new CommonFeeInfo();
     list.Add(cInfo);
     return list;
 }
Exemple #2
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="ID">实体主键</param>
 /// <returns></returns>
 public void Delete(string ID)
 {
     CommonFeeInfo cInfo = new CommonFeeInfo(ID);
     dal.Delete(cInfo);
 }
Exemple #3
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 /// <returns>新增实体的主键</returns>
 public string Add(CommonFeeInfo cInfo)
 {
     return dal.Add(cInfo);
 }
Exemple #4
0
 /// <summary>
 /// 更新费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 public void Update(CommonFeeInfo cInfo)
 {
     if (string.IsNullOrEmpty(cInfo.ID))
     {
         throw new ArgumentNullException("参数ID不能为空。");
     }
     dal.Update(cInfo);
 }
        protected void gvList_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            try
            {
                string strIndex = e.CommandArgument.ToString();
                int index = Convert.ToInt32(strIndex);
                GridViewRow gvr = (GridViewRow)gvList.Rows[index];
                Label lblID = (Label)gvr.FindControl("lblID");
                string tID = lblID.Text;

                if (e.CommandName == "btnDel")
                {
                    new CommonFee().Delete(tID);
                }
                else
                {
                    Label lbFeeCatalogID = (Label)gvr.FindControl("lbFeeCatalogID");
                    Label lbName = (Label)gvr.FindControl("lbName");
                    TextBox tbAmout = (TextBox)gvr.FindControl("tbAmout");
                    DropDownList ddlListCurrency = (DropDownList)gvr.FindControl("ddlListCurrency");
                    DropDownList ddlFeeCatalog = (DropDownList)gvr.FindControl("ddlFeeCatalog");
                    TextBox tbCreateTime = (TextBox)gvr.FindControl("tbCreateTime");
                    TextBox tbRemark = (TextBox)gvr.FindControl("tbRemark");
                    CommonFeeInfo info = new CommonFeeInfo(tID);
                    if (string.IsNullOrEmpty(tID) == false)
                    {
                        info = new CommonFee().GetByID(tID);
                    }
                    info.Amount = tbAmout.Text;
                    WebBasePage page = this.Page as WebBasePage;
                    if (null == page)
                    {
                        this.ShowMsg("无法获取当前用户信息,请返回登录页重新登录。");
                        return;
                    }
                    info.ApproveUserID = page.UserCacheInfo.ID;
                    info.CurrencyID = ddlListCurrency.SelectedValue;
                    if (string.IsNullOrEmpty(this.DimTimeID) == false)
                    {
                        info.DimTimeID = this.DimTimeID;
                    }
                    info.FeeCatalogID = ddlFeeCatalog.SelectedValue;
                    info.备注 = tbRemark.Text;

                    if (e.CommandName == "btnEdit")
                    {
                        new CommonFee().Update(info);
                    }

                    if (e.CommandName == "btnAdd")
                    {
                        new CommonFee().Add(info);
                    }
                    ShowMsg("操作成功!");
                }
                BindGrid(this.DimTimeID, this.DepartmentID);
            }
            catch (ArgumentException ae)
            {
                this.ShowMsg(ae.Message);
            }
            catch (Exception exc)
            {
                ShowMsg(exc.Message);
                //Log(exc);
            }
        }