public void AddReimbursement([FromBody] ReimbursementItem reimbursementData)
        {
            ReimbursementInfo newReimbursement = new ReimbursementInfo();

            newReimbursement = _mapper.Map <ReimbursementItem, ReimbursementInfo>(reimbursementData);

            _unitofWork.ReimbursementRepository.Add(newReimbursement);
            int i = _unitofWork.Complete();
        }
Exemple #2
0
        /// <summary>
        /// 修改
        /// </summary>
        /// <returns></returns>
        public int UpdateReimburse(ReimbursementInfo infos)
        {
            string sql = @"update ApplyManager set 
            ApplyName=@ApplyName,
            CostId=@CostId,
            ApplyTime=@ApplyTime,
            Money=@Money,
            ApplyExplain=@ApplyExplain
            where Id=@Id ";

            return(DapperHelper <ReimbursementInfo> .Execute(sql, infos));
        }
Exemple #3
0
        public void add(ReimbursementInfo model)
        {
            string str = helper.Post("api/Reim/AddReimburse", JsonConvert.SerializeObject(model));
            int    i   = int.Parse(str);

            if (i > 0)
            {
                Response.Write("<script>alert('添加成功');location.href='/Reim/Show/'</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败')</script>");
            }
        }
Exemple #4
0
        private void Bind()
        {
            try
            {
                ReimbursementInfo ReimbursementInfo = new ReimbursementInfo();
                DataTable         table             = ReimbursementInfo.GetRBinfo3();
                if (table.Rows.Count > 0)
                {
                    table.Columns.Add("RB_COSTCENTERNAME", typeof(System.String));
                    table.Columns.Add("RBROW_AMOUNT_FORMAT", typeof(System.String));
                    table.Columns.Add("RBUSERDATE", typeof(System.String));
                    table.Columns.Add("NOTE", typeof(System.String));
                    foreach (DataRow row in table.Rows)
                    {
                        row["RB_COSTCENTERNAME"]   = row["RB_COSTCENTER"] + " Demo";
                        row["RBROW_AMOUNT_FORMAT"] = "¥" + row["RBROW_AMOUNT"].ToString();

                        if (row["RB_NOTE"].ToString().Length > 0)
                        {
                            row["NOTE"] = "备注:" + row["RB_NOTE"];
                        }
                        else
                        {
                            row["NOTE"] = "备注:";
                        }

                        row["RBUSERDATE"] = row["RB_USER"] + " " + Convert.ToDateTime(row["CREATEDATE"]).ToShortDateString();
                    }
                    this.GridView1.DataSource = table;
                    this.GridView1.DataBind();
                }
                else
                {
                    this.GridView1.Rows.Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
        public void UpdateReimbursement([FromBody] ReimbursementItem reimbursementData)
        {
            ReimbursementInfo newReimbursement = _unitofWork.ReimbursementRepository.Get(reimbursementData.ReimbursementInfoId);

            newReimbursement.ReimbursementInfoId       = reimbursementData.ReimbursementInfoId;
            newReimbursement.ProjectCode               = reimbursementData.ProjectCode;
            newReimbursement.PurposeofTravel           = reimbursementData.PurposeofTravel;
            newReimbursement.EmployeeId                = reimbursementData.EmployeeId;
            newReimbursement.EmployeeName              = reimbursementData.EmployeeName;
            newReimbursement.BandWorkLevel             = reimbursementData.BandWorkLevel;
            newReimbursement.ClientName                = reimbursementData.ClientName;
            newReimbursement.CostCenter                = reimbursementData.CostCenter;
            newReimbursement.DateofArrival             = reimbursementData.DateofArrival;
            newReimbursement.DateofDeparture           = reimbursementData.DateofDeparture;
            newReimbursement.Designation               = reimbursementData.Designation;
            newReimbursement.FlightChargesReimbursed   = reimbursementData.FlightChargesReimbursed;
            newReimbursement.LocationofTravel          = reimbursementData.LocationofTravel;
            newReimbursement.TravelBillabletoCustomer  = reimbursementData.TravelBillabletoCustomer;
            newReimbursement.TravelExpenseReimbursed   = reimbursementData.TravelExpenseReimbursed;
            newReimbursement.AnyOtherExpenseReimbursed = reimbursementData.AnyOtherExpenseReimbursed;

            int i = _unitofWork.Complete();
        }
Exemple #6
0
 /// <summary>
 /// 修改项目
 /// </summary>
 /// <returns></returns>
 public int UpdateReimburse(ReimbursementInfo infos)
 {
     return(ReimBll.Instance.UpdateReimburse(infos));
 }
Exemple #7
0
 /// <summary>
 /// 新增项目
 /// </summary>
 public int AddReimburse(ReimbursementInfo info)
 {
     return(ReimBll.Instance.AddReimburse(info));
 }
Exemple #8
0
 /// <summary>
 /// 修改项目
 /// </summary>
 /// <returns></returns>
 public int UpdateReimburse(ReimbursementInfo infos)
 {
     return(dal.UpdateReimburse(infos));
 }
Exemple #9
0
 /// <summary>
 /// 新增项目
 /// </summary>
 public int AddReimburse(ReimbursementInfo info)
 {
     return(dal.AddReimburse(info));
 }
Exemple #10
0
        /// <summary>
        /// 初始化方法
        /// </summary>
        /// <remarks></remarks>
        private void Bind()
        {
            try
            {
                DataTable table = new DataTable();
                switch (btnMode)
                {
                case 1:
                    TextTabBar1.SelectItemIndex = 0;
                    this.GridView1.Layout       = "frmConsumptionLayout";
                    ConsumptionInfo Consumptioninfo = new ConsumptionInfo();
                    table = Consumptioninfo.GetConsumptioninfo();
                    break;

                case 2:
                    TextTabBar1.SelectItemIndex = 1;
                    this.GridView1.Layout       = "frmRBlayout";
                    ReimbursementInfo ReimbursementInfo = new ReimbursementInfo();
                    table = ReimbursementInfo.GetRBinfo();
                    break;
                }
                if (table.Rows.Count > 0)
                {
                    switch (btnMode)
                    {
                    case 1:

                        table.Columns.Add("ROW_DATE", typeof(System.String));
                        table.Columns.Add("ROW_NOTE", typeof(System.String));
                        foreach (DataRow row in table.Rows)
                        {
                            if (row["RBROW_NOTE"].ToString().Length > 0)
                            {
                                row["ROW_NOTE"] = row["RBROW_NOTE"];
                            }
                            else
                            {
                                row["ROW_NOTE"] = "无";
                            }

                            row["ROW_DATE"] = Convert.ToDateTime(row["RBROW_DATE"]).ToShortDateString();
                        }

                        break;

                    case 2:
                        table.Columns.Add("RB_COSTCENTERNAME", typeof(System.String));
                        table.Columns.Add("RBROW_AMOUNT_FORMAT", typeof(System.String));
                        table.Columns.Add("RBUSERDATE", typeof(System.String));
                        table.Columns.Add("NOTE", typeof(System.String));
                        foreach (DataRow row in table.Rows)
                        {
                            row["RB_COSTCENTERNAME"]   = row["RB_COSTCENTER"] + " Demo";
                            row["RBROW_AMOUNT_FORMAT"] = "¥" + row["RBROW_AMOUNT"].ToString();

                            if (row["RB_NOTE"].ToString().Length > 0)
                            {
                                row["NOTE"] = "备注:" + row["RB_NOTE"];
                            }
                            else
                            {
                                row["NOTE"] = "备注:";
                            }

                            row["RBUSERDATE"] = Convert.ToDateTime(row["CREATEDATE"]).ToShortDateString();
                        }

                        break;
                    }
                    //赋值GridView1数据
                    this.GridView1.DataSource = table;
                    this.GridView1.DataBind();
                }
                else
                {
                    this.GridView1.Rows.Clear();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #11
0
        /// <summary>
        /// 新增详情
        /// </summary>
        public int AddReimburse(ReimbursementInfo info)
        {
            string sql = "insert into  ApplyManager (ApplyName,CostId,ApplyTime,Money,ApplyExplain) values(@ApplyName,@CostId,@ApplyTime,@Money,@ApplyExplain)";

            return(DapperHelper <ReimbursementInfo> .Execute(sql, info));
        }