/// <summary> /// 事件提交 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtn_Submit_Click(object sender, EventArgs e) { EyouSoft.BLL.FinanceStructure.TourProfitSharer bll = new EyouSoft.BLL.FinanceStructure.TourProfitSharer(SiteUserInfo); EyouSoft.Model.FinanceStructure.TourProfitShareInfo model = null; if (Utils.GetInt(Request.QueryString["id"]) > 0) { model = bll.GetModel(Utils.GetQueryStringValue("id")); } else { model = new EyouSoft.Model.FinanceStructure.TourProfitShareInfo(); } model.CompanyId = CurrentUserCompanyID; model.CreateTime = DateTime.Now; model.DepartmentId = Utils.GetInt(UCSelectDepartment1.GetDepartId); model.DepartmentName = UCSelectDepartment1.GetDepartmentName; model.Remark = EyouSoft.Common.Utils.GetFormValue("txt_Remarks"); model.OperatorId = SiteUserInfo.ID; model.SaleId = EyouSoft.Common.Utils.GetInt(selectOperator1.OperId); model.Saler = selectOperator1.OperName; model.ShareCost = EyouSoft.Common.Utils.GetDecimal(txt_IncomeMoney.Text); model.ShareItem = txt_Income.Text; model.TourId = Request.QueryString["tourId"]; if (bll.AddTourShare(model) > 0) { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('添加成功!');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.window.location.reload();"); } else { EyouSoft.Common.Function.MessageBox.ResponseScript(this, "javascript:alert('添加失败!');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.window.location.reload();"); } }
/// <summary> /// 绑定信息 /// </summary> /// <param name="id"></param> void BindInfo(string id) { EyouSoft.BLL.FinanceStructure.TourProfitSharer bll = new EyouSoft.BLL.FinanceStructure.TourProfitSharer(SiteUserInfo); EyouSoft.Model.FinanceStructure.TourProfitShareInfo model = bll.GetModel(id); if (model != null) { txt_Income.Text = model.ShareItem; txt_IncomeMoney.Text = model.ShareCost.ToString(); txt_Remarks.Value = model.Remark; UCSelectDepartment1.GetDepartId = model.DepartmentId.ToString(); UCSelectDepartment1.GetDepartmentName = model.DepartmentName; selectOperator1.OperId = model.SaleId.ToString(); selectOperator1.OperName = model.Saler; } }
protected void btnSave_Click(object sender, EventArgs e) { string tourId = Utils.InputText(this.hidePlanID.Value); bool isUpdate = true; #region 收入 //订单号 string[] hideFrist = Utils.GetFormValues("hideFrist"); if (hideFrist != null && hideFrist.Count() > 0) { IList <EyouSoft.Model.TourStructure.OrderFinanceExpense> list = new List <EyouSoft.Model.TourStructure.OrderFinanceExpense>(); for (int i = 0; i < hideFrist.Count(); i++) { EyouSoft.Model.TourStructure.OrderFinanceExpense model = new EyouSoft.Model.TourStructure.OrderFinanceExpense(); //ID string id = hideFrist[i]; //公司名称 //string hideFristCompanyName = Utils.GetFormValue("hideFristCompanyName_" + id); //收入金额 string hideFristIncome = Utils.GetFormValue("hideFristIncome_" + id); //增加费用 string incomeAdd = Utils.GetFormValue("txtIncomeAdd_" + id); //减少费用 string incomeReduc = Utils.GetFormValue("txtIncomeReduc_" + id); //备注 string incomeRemarks = Utils.GetFormValue("txtIncomeRemarks_" + id); model.OrderId = id; //model.CompanyName = hideFristCompanyName; model.SumPrice = Utils.GetDecimal(hideFristIncome); model.FinanceAddExpense = Utils.GetDecimal(incomeAdd); model.FinanceRedExpense = Utils.GetDecimal(incomeReduc); //计算小计 model.FinanceSum = model.SumPrice + model.FinanceAddExpense - model.FinanceRedExpense; model.FinanceRemark = incomeRemarks; list.Add(model); } isUpdate = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo).UpdateFinanceExpense(list, tourId); } #endregion #region 其它收入 string[] hideSecond = Utils.GetFormValues("hideSecond"); if (hideSecond != null && hideSecond.Count() > 0) { IList <EyouSoft.Model.FinanceStructure.OtherIncomeInfo> list = new List <EyouSoft.Model.FinanceStructure.OtherIncomeInfo>(); for (int i = 0; i < hideSecond.Count(); i++) { EyouSoft.Model.FinanceStructure.OtherIncomeInfo model = new EyouSoft.Model.FinanceStructure.OtherIncomeInfo(); string id = hideSecond[i]; //收入金额 string hideOtherIncome = Utils.GetFormValue("hideOtherIncome_" + id); //增加费用 string otherAdd = Utils.GetFormValue("txtOtherAdd_" + id); //减少费用 string otherReduc = Utils.GetFormValue("txtOtherReduc_" + id); //备注 string otherRemarks = Utils.GetFormValue("txtOtherRemarks_" + id); model.IncomeId = id; model.Amount = Utils.GetDecimal(hideOtherIncome); model.AddAmount = Utils.GetDecimal(otherAdd); model.ReduceAmount = Utils.GetDecimal(otherReduc); model.TotalAmount = model.Amount + model.AddAmount - model.ReduceAmount; model.Remark = otherRemarks; model.TourId = tourId; list.Add(model); } int count = new EyouSoft.BLL.FinanceStructure.OtherCost(SiteUserInfo).UpdateOtherIncome(list); if (count <= 0) { isUpdate = false; } } #endregion #region 团队计划 && 散拼计划 支出 string[] hideThird = Utils.GetFormValues("hideThird"); if (hideThird != null && hideThird.Count() > 0) { IList <EyouSoft.Model.PlanStructure.PaymentList> list = new List <EyouSoft.Model.PlanStructure.PaymentList>(); for (int i = 0; i < hideThird.Count(); i++) { EyouSoft.Model.PlanStructure.PaymentList model = new EyouSoft.Model.PlanStructure.PaymentList(); string id = hideThird[i]; //金额 string hideExpendIncome = Utils.GetFormValue("hideExpendIncome_" + id); //增加费用 string expendAdd = Utils.GetFormValue("txtExpendAdd_" + id); //减少费用 string expendLess = Utils.GetFormValue("txtExpendLess_" + id); //备注 string expendRemarks = Utils.GetFormValue("txtExpendRemarks_" + id); //类型 string supplierType = Utils.GetFormValue("hideSupplierType_" + id); model.Id = id; model.PayAmount = Utils.GetDecimal(hideExpendIncome); model.AddAmount = Utils.GetDecimal(expendAdd); model.ReduceAmount = Utils.GetDecimal(expendLess); model.TotalAmount = model.PayAmount + model.AddAmount - model.ReduceAmount; model.FRemark = expendRemarks; model.SupplierType = (EyouSoft.Model.EnumType.CompanyStructure.SupplierType)Enum.Parse(typeof(EyouSoft.Model.EnumType.CompanyStructure.SupplierType), supplierType); list.Add(model); } bool result = new EyouSoft.BLL.PlanStruture.TravelAgency().UpdateSettle(list, tourId); if (!result) { isUpdate = false; } } #endregion #region 单项服务 string[] hideThird_S = Utils.GetFormValues("hideThird-S"); if (hideThird_S != null && hideThird_S.Count() > 0) { IList <EyouSoft.Model.TourStructure.PlanSingleInfo> list = new List <EyouSoft.Model.TourStructure.PlanSingleInfo>(); for (int i = 0; i < hideThird_S.Count(); i++) { EyouSoft.Model.TourStructure.PlanSingleInfo model = new EyouSoft.Model.TourStructure.PlanSingleInfo(); string id = hideThird_S[i]; //金额 string hideExpendIncome = Utils.GetFormValue("hideExpendIncome-S_" + id); //增加费用 string expendAdd = Utils.GetFormValue("txtExpendAdd-S_" + id); //减少费用 string expendLess = Utils.GetFormValue("txtExpendLess-S_" + id); //备注 string expendRemarks = Utils.GetFormValue("txtExpendRemarks-S_" + id); //类型 string serviceType = Utils.GetFormValue("hideSupplierType-S_" + id); model.PlanId = id; model.Amount = Utils.GetDecimal(hideExpendIncome); model.AddAmount = Utils.GetDecimal(expendAdd); model.ReduceAmount = Utils.GetDecimal(expendLess); model.TotalAmount = model.Amount + model.AddAmount - model.ReduceAmount; model.FRemark = expendRemarks; model.ServiceType = (EyouSoft.Model.EnumType.TourStructure.ServiceType)Enum.Parse(typeof(EyouSoft.Model.EnumType.TourStructure.ServiceType), serviceType); list.Add(model); } int result = new EyouSoft.BLL.PlanStruture.PlanSingle().SetSingleAccounting(tourId, list); if (result <= 0) { isUpdate = false; } } #endregion #region 其它支出 string[] hideForth = Utils.GetFormValues("hideForth"); if (hideForth != null && hideForth.Count() > 0) { IList <EyouSoft.Model.FinanceStructure.OtherOutInfo> list = new List <EyouSoft.Model.FinanceStructure.OtherOutInfo>(); for (int i = 0; i < hideForth.Count(); i++) { EyouSoft.Model.FinanceStructure.OtherOutInfo model = new EyouSoft.Model.FinanceStructure.OtherOutInfo(); string id = hideForth[i]; //支出金额 string hideOutIncome = Utils.GetFormValue("hideOutIncome_" + id); //增加费用 string outAdd = Utils.GetFormValue("txtOutAdd_" + id); //减少费用 string outLess = Utils.GetFormValue("txtOutLess_" + id); //备注 string outRemarks = Utils.GetFormValue("txtOutRemarks_" + id); model.OutId = id; model.Amount = Utils.GetDecimal(hideOutIncome); model.AddAmount = Utils.GetDecimal(outAdd); model.ReduceAmount = Utils.GetDecimal(outLess); model.TotalAmount = model.Amount + model.AddAmount - model.ReduceAmount; model.Remark = outRemarks; model.TourId = tourId; list.Add(model); } int count = new EyouSoft.BLL.FinanceStructure.OtherCost(SiteUserInfo).UpdateOtherOut(list); if (count <= 0) { isUpdate = false; } } #endregion #region 利润分配 string[] hideFifth = Utils.GetFormValues("hideFifth"); if (hideFifth != null && hideFifth.Count() > 0) { IList <EyouSoft.Model.FinanceStructure.TourProfitShareInfo> list = new List <EyouSoft.Model.FinanceStructure.TourProfitShareInfo>(); for (int i = 0; i < hideFifth.Count(); i++) { EyouSoft.Model.FinanceStructure.TourProfitShareInfo model = new EyouSoft.Model.FinanceStructure.TourProfitShareInfo(); string id = hideFifth[i]; //分配金额 string shareCost = Utils.GetFormValue("txtShareCost_" + id); //备注 string profitAll = Utils.GetFormValue("txtProfitRemarks_" + id); model.ShareId = id; model.ShareCost = Utils.GetDecimal(shareCost); model.CompanyId = SiteUserInfo.CompanyID; model.TourId = tourId; model.Remark = profitAll; model.CompanyId = SiteUserInfo.CompanyID; list.Add(model); } int count = new EyouSoft.BLL.FinanceStructure.TourProfitSharer(SiteUserInfo).UpdateTourShare(list); if (count <= 0) { isUpdate = false; } } if (isUpdate) { Utils.ShowAndRedirect("修改成功!", Request.Url.ToString()); } else { Utils.ShowAndRedirect("修改失败!", Request.Url.ToString()); } #endregion }