/// <summary> /// 页面初始化 /// </summary> /// <param name="id"></param> private void PageInit(string id) { BTour bll = new BTour(); EyouSoft.Model.TourStructure.MTourBaseInfo model = bll.GetTourInfo(id); //lblTourCode.Text = bll.GenerateTourNo(SiteUserInfo.DeptId, SiteUserInfo.CompanyId, model.TourType, (DateTime)model.LDate); if (model != null) { if (model.TourService != null) { //绑定内部信息 this.txtInsiderInfor.Text = model.TourService.InsiderInfor; } if (model.TourPlanItem != null) { for (int i = 0; i < model.TourPlanItem.Count; i++) { //绑定原计调安排项 this.hidePlanItem.Value += ((int)model.TourPlanItem[i].PlanType).ToString() + ","; } } if (model.TourPlaner != null && model.TourPlaner.Count > 0) { for (int i = 0; i < model.TourPlaner.Count; i++) { this.SellsSelect1.SellsID += model.TourPlaner[i].PlanerId + ","; this.SellsSelect1.SellsName += model.TourPlaner[i].Planer + ","; } //绑定 计调员 this.SellsSelect1.SellsID = this.SellsSelect1.SellsID.Remove(this.SellsSelect1.SellsID.Length - 1, 1); this.SellsSelect1.SellsName = this.SellsSelect1.SellsName.Remove(this.SellsSelect1.SellsName.Length - 1, 1); } } bll = null; }
/// <summary> /// 保存按钮点击事件执行方法 /// </summary> private string PageSave() { string msg = string.Empty; //获取表单 string[] sellsArray = Utils.GetFormValue(this.SellsSelect1.SellsIDClient).Split(','); //string[] sellsNameArray = Utils.GetFormValue(this.SellsSelect1.SellsNameClient).Split(','); //string[] sellsDeptArray = Utils.GetFormValue(this.hideDeptId.UniqueID).Split(','); string[] item = Utils.GetFormValues("chk_item"); string tourId = Utils.GetQueryStringValue("tourID"); string insiderInfor = Utils.GetFormValue(this.txtInsiderInfor.UniqueID); //验证 if (sellsArray.Length == 0) { return(UtilsCommons.AjaxReturnJson("0", "请选择计调员!")); } if (item.Length == 0) { return(UtilsCommons.AjaxReturnJson("0", "请选择计调安排项目!")); } BTour bll = new BTour(); IList <EyouSoft.Model.TourStructure.MTourPlaner> TourPlaner = new List <EyouSoft.Model.TourStructure.MTourPlaner>(); for (int i = 0; i < sellsArray.Length; i++) { EyouSoft.Model.TourStructure.MTourPlaner planerModel = new EyouSoft.Model.TourStructure.MTourPlaner(); planerModel.PlanerId = sellsArray[i]; //planerModel.Planer = sellsNameArray[i]; //planerModel.DeptId = Utils.GetInt(sellsDeptArray[i]); planerModel.TourId = tourId; TourPlaner.Add(planerModel); } IList <EyouSoft.Model.TourStructure.MTourPlanItem> TourPlanItem = new List <EyouSoft.Model.TourStructure.MTourPlanItem>(); for (int i = 0; i < item.Length; i++) { EyouSoft.Model.TourStructure.MTourPlanItem tpiModel = new EyouSoft.Model.TourStructure.MTourPlanItem(); tpiModel.TourId = tourId; tpiModel.PlanType = (EyouSoft.Model.EnumType.PlanStructure.PlanProject)Utils.GetInt(item[i]); TourPlanItem.Add(tpiModel); } EyouSoft.Model.TourStructure.MTourBaseInfo tourModel = bll.GetTourInfo(tourId); if (tourModel != null) { EyouSoft.Model.TourStructure.MSendTour sendTourModel = new EyouSoft.Model.TourStructure.MSendTour(); sendTourModel.CompanyId = SiteUserInfo.CompanyId; sendTourModel.DeptId = SiteUserInfo.DeptId; sendTourModel.InsiderInfor = insiderInfor; sendTourModel.LDate = Convert.ToDateTime(tourModel.LDate); sendTourModel.Operator = SiteUserInfo.Name; sendTourModel.OperatorId = SiteUserInfo.UserId; sendTourModel.Planer = TourPlaner; sendTourModel.PlanItem = TourPlanItem; //sendTourModel.TourCode = bll.GenerateTourNo(SiteUserInfo.DeptId, SiteUserInfo.CompanyId, tourModel.TourType, sendTourModel.LDate); sendTourModel.TourId = tourId; sendTourModel.TourType = tourModel.TourType; bool result = false; lock (PaiTuanXuHaoLockHelper) { result = bll.SendTour(sendTourModel); } if (result) { msg = UtilsCommons.AjaxReturnJson("1", "安排计调成功!"); } else { msg = UtilsCommons.AjaxReturnJson("0", "安排计调失败!"); } } return(msg); }
/// <summary> /// 权限判断 /// </summary> private void PowerControl(string tourId) { BTour bll = new BTour(); //团队实体 MTourBaseInfo model = bll.GetTourInfo(tourId); if (model != null) { /* 根据页面来源判断 利润分配列表是否显示 * 计调终审-计调终审 无法查看利润分配 */ int source = Utils.GetInt(Utils.GetQueryStringValue("source")); if (source > 1) { //初始化利润分配 MoneyDistribute(tourId); //利润分配添加修改权限控制 pan_AddMongyAllot.Visible = model.TourStatus == TourStatus.财务核算; //利润分配栏目 财务进入 pan_moneyAllot.Visible = true; } /* * 退回计调 * 待终审状态 And 不是财务进去 */ pan_returnOperater.Visible = CheckGrant(Privs.计调中心_计调终审_退回计调操作) && (model.TourStatus == TourStatus.待终审 && source <= 1); /* * 提交财务 * 待终审状态 And 不是财务进去 */ pan_submitFinance.Visible = CheckGrant(Privs.计调中心_计调终审_提交财务操作) && (model.TourStatus == TourStatus.待终审 && source <= 1); /* * 退回终审 * 财务核算状态 And 不是计调进入 */ pan_returnCourtFinal.Visible = CheckGrant(Privs.财务管理_报销报账_核算结束) && (model.TourStatus == TourStatus.财务核算 && source > 1); //系统配置实体 MComSetting comModel = new BComSetting().GetModel(CurrentUserCompanyID) ?? new MComSetting(); //封团 pan_sealTour.Visible = (source > 1) && CheckGrant(Privs.财务管理_报销报账_核算结束) && bll.GetCostStatus(tourId) && (model.IsSubmit || model.GuideList == null) && ((model.TourStatus == TourStatus.待终审 && comModel.SkipFinalJudgment) || (model.TourStatus == TourStatus.财务核算 && model.GuideList == null) || (model.TourStatus == TourStatus.财务核算 && model.GuideList != null && model.IsSubmit)); //系统配置实体 //如果是单团核算 财务入账 if (source == 2) { pan_InAccount.Visible = (CheckGrant(Privs.财务管理_单团核算_核算结束)) && comModel.IsEnableKis && model.TourStatus == TourStatus.封团; } //如果是报销报账 财务入账 if (source == 3) { pan_InAccount.Visible = (CheckGrant(Privs.财务管理_报销报账_核算结束)) && comModel.IsEnableKis && model.TourStatus == TourStatus.封团; } } }