protected int RecordCount = 0; //总记录数 #endregion protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { PageIndex = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("Page"), 1); EyouSoft.BLL.CompanyStructure.Customer custBll = new EyouSoft.BLL.CompanyStructure.Customer(); //客户资料bll EyouSoft.Model.CompanyStructure.CustomerInfo custModel = null; //客户资料实体 int custId = EyouSoft.Common.Utils.GetInt(EyouSoft.Common.Utils.GetQueryStringValue("custId")); if (custId > 0) { custModel = new EyouSoft.Model.CompanyStructure.CustomerInfo(); custModel = custBll.GetCustomerModel(custId); //获取联系人集合 IList <EyouSoft.Model.CompanyStructure.CustomerContactInfo> custList = custModel.CustomerContactList; if (custList != null && custList.Count > 0) { this.CloseNumberList.DataSource = custList; this.CloseNumberList.DataBind(); BIndPage(); } else { this.Close_ExportPageInfo1.Visible = false; } } } }
protected void Page_Load(object sender, EventArgs e) { //省份 ProvinceList1.CompanyId = SiteUserInfo.CompanyID; ProvinceList1.IsFav = true; //城市 CityList1.CompanyId = SiteUserInfo.CompanyID; CityList1.IsFav = true; if (Utils.GetInt(Utils.GetQueryStringValue("issave")) == 1) { this.InitBindCompany(); } else { #region 初始化公司信息 if (!this.Page.IsPostBack) { CustomerInfo = Customer.GetCustomerModel(SiteUserInfo.TourCompany.TourCompanyId); if (CustomerInfo != null) { this.ProvinceList1.ProvinceId = CustomerInfo.ProviceId; this.CityList1.ProvinceId = CustomerInfo.ProviceId; CityList1.CityId = CustomerInfo.CityId; //公司名称 this.Txt_UnitsName.Value = CustomerInfo.Name; //许可证 this.Txt_LicenseNumber.Value = CustomerInfo.Licence; //公司地址 this.Txt_CompanyAddress.Value = CustomerInfo.Adress; //邮编 this.Txt_Code.Value = CustomerInfo.PostalCode; //开户账号 this.Txt_AccountNumber.Value = CustomerInfo.BankAccount; //返佣类型 if (this.DDlReBateType.Items.FindByValue(((int)CustomerInfo.CommissionType).ToString()) != null) { this.DDlReBateType.Items.FindByValue(((int)CustomerInfo.CommissionType).ToString()).Selected = true; } //主要联系人 this.Txt_Contact.Value = CustomerInfo.ContactName; //电话 this.Txt_Phone.Value = CustomerInfo.Phone; //手机 this.Txt_Mobile.Value = CustomerInfo.Mobile; //传真 this.Txt_Fox.Value = CustomerInfo.Fax; //备注 this.Txt_Remirke.Value = CustomerInfo.Remark; } } CustomerInfo = null; #endregion } }
protected void Page_Load(object sender, EventArgs e) { LoadVisitors1.CurrentPageIframeId = Utils.GetQueryStringValue("iframeId");// Request.QueryString["iframeId"]; if (!IsPostBack) { #region 获取客户单位的责任销售 if (Utils.GetQueryStringValue("act") == "getSeller") { Response.Clear(); int comId = Utils.GetInt(Utils.GetQueryStringValue("comId")); EyouSoft.BLL.CompanyStructure.Customer custBll = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CustomerInfo cusModel = custBll.GetCustomerModel(comId); if (cusModel != null) { string saler = cusModel.Saler == null || cusModel.Saler == "" ? "暂无销售" : cusModel.Saler; StringBuilder jsonNameAndId = new StringBuilder(); string userList = ""; jsonNameAndId.Append("["); foreach (var vc in cusModel.CustomerContactList) { jsonNameAndId.Append("{\"Name\":\"" + vc.Name + "\",\"ID\":" + vc.ID + "},"); } userList = jsonNameAndId.ToString().TrimEnd(','); userList += "]"; Response.Write("[{\"saler\":\"" + saler + "\",cusList:" + userList + ",\"CommissionType\":\"" + ((int)cusModel.CommissionType).ToString() + "\",CommissionCount:" + Utils.FilterEndOfTheZeroDecimal(cusModel.CommissionCount) + "}]"); } Response.End(); } #endregion BindXlInfo(); BindPireList(); strTraffic = GetSelectTraffic(-1); #region //配置留位时间读取 EyouSoft.BLL.CompanyStructure.CompanySetting setBll = new EyouSoft.BLL.CompanyStructure.CompanySetting(); //初始化bll EyouSoft.Model.CompanyStructure.CompanyFieldSetting set = null; //配置实体 set = setBll.GetSetting(CurrentUserCompanyID); txtEndTime.Attributes["onfocus"] = "WdatePicker({errDealMode:1,minDate:'" + DateTime.Now.ToString() + "',maxDate:'" + DateTime.Now.AddMinutes(set.ReservationTime).ToString() + "',dateFmt:'yyyy/MM/dd HH:mm',alwaysUseStartDate:true});"; hd_waitTime.Value = set.ReservationTime.ToString(); hd_IsRequiredTraveller.Value = set.IsRequiredTraveller.ToString(); #endregion } #region 获取关联交通成本价 if (Utils.GetQueryStringValue("act") == "getPrice") { GetPrice(); } #endregion }
/// <summary> /// 注册用户 /// </summary> protected void lkBtnSave_Click(object sender, EventArgs e) { #region 验证 if (string.IsNullOrEmpty(Utils.GetFormValue(this.txtProvince.UniqueID))) { Response.Write("<script>alert('请选择省份!');location.href=location.href</script>"); return; } if (string.IsNullOrEmpty(Utils.GetFormValue("txtCity"))) { Response.Write("<script>alert('请选择城市!');location.href=location.href</script>"); return; } if (string.IsNullOrEmpty(this.txtCompanyName.Text.Trim())) { Response.Write("<script>alert('请请输入单位名称!');location.href=location.href</script>"); return; } if (string.IsNullOrEmpty(this.txtUserName.Text.Trim())) { Response.Write("<script>alert('请输入用户名!');location.href=location.href</script>"); return; } if (string.IsNullOrEmpty(this.txtUserPwd.Text.Trim())) { Response.Write("<script>alert('请输入密码!');location.href=location.href</script>"); return; } #endregion //声明新的对象 EyouSoft.Model.CompanyStructure.CustomerInfo custModel = new EyouSoft.Model.CompanyStructure.CustomerInfo(); //联系人集合 IList <EyouSoft.Model.CompanyStructure.CustomerContactInfo> list = new List <EyouSoft.Model.CompanyStructure.CustomerContactInfo>(); //声明联系人 EyouSoft.Model.CompanyStructure.CustomerContactInfo custInfo = new EyouSoft.Model.CompanyStructure.CustomerContactInfo(); //联系人账户信息赋值 custInfo.UserAccount = new EyouSoft.Model.CompanyStructure.UserAccount(); custInfo.UserAccount.CompanyId = Master.CompanyId; custInfo.UserAccount.UserName = txtUserName.Text; custInfo.Sex = "0"; custInfo.UserAccount.PassWordInfo = new EyouSoft.Model.CompanyStructure.PassWord { NoEncryptPassword = txtUserPwd.Text }; list.Add(custInfo); #region Model赋值 custModel.Name = this.txtCompanyName.Text.Trim(); //单位名称 custModel.Licence = this.txtLicense.Text.Trim(); //许可证号 custModel.Adress = this.txtAddress.Text.Trim(); //地址 custModel.PostalCode = this.txtPostalCode.Text.Trim(); //邮编 custModel.ContactName = this.txtContact.Text.Trim(); //主要联系人 custModel.Phone = this.txtTel.Text.Trim(); //电话 custModel.Mobile = this.txtPhone.Text; //手机 custModel.Fax = this.txtFax.Text.Trim(); //传真 custModel.ProviceId = Utils.GetInt(Utils.GetFormValue(this.txtProvince.UniqueID)); //省份ID custModel.CityId = Utils.GetInt(Utils.GetFormValue("txtCity")); //城市ID custModel.CustomerContactList = list; custModel.CompanyId = Master.CompanyId; //所属公司 custModel.IssueTime = DateTime.Now; custModel.IsEnable = false; custModel.IsDelete = false; #endregion int count = new EyouSoft.BLL.CompanyStructure.Customer().AddCustomer(custModel); if (count > 0) { Response.Write("<script>alert('注册成功');location.href=location.href;</script>"); } else { Response.Write("<script>alert('注册失败');location.href=location.href;</script>"); } }
protected void Page_Load(object sender, EventArgs e) { //判断权限 if (!CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_导入客户)) { Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.客户关系管理_客户资料_导入客户, true); return; } EyouSoft.BLL.CompanyStructure.Customer custBll = new EyouSoft.BLL.CompanyStructure.Customer();//客户bll string method = Utils.GetFormValue("method"); if (method == "save") { #region 导入 bool result = false; string[] customerArr = Utils.GetFormValues("custData");//获取导入的客户 if (customerArr != null && customerArr.Length > 0) { IList <EyouSoft.Model.CompanyStructure.CustomerInfo> custList = new List <EyouSoft.Model.CompanyStructure.CustomerInfo>(); foreach (string cust in customerArr) { string[] custArr = cust.Split(',');//获取每个客户的信息 //单位名称 int sname = Utils.GetQueryStringValue("sname") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("sname")); //许可证号 int slice = Utils.GetQueryStringValue("slice") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("slice")); //地址 int sadd = Utils.GetQueryStringValue("sadd") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("sadd")); //邮编 int scode = Utils.GetQueryStringValue("scode") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("scode")); //传真 int sfax = Utils.GetQueryStringValue("sfax") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("sfax")); //主要联系人 int scon = Utils.GetQueryStringValue("scon") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("scon")); //电话 int stel = Utils.GetQueryStringValue("stel") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("stel")); //手机 int smob = Utils.GetQueryStringValue("smob") == "-1" ? -1 : Utils.GetInt(Utils.GetQueryStringValue("smob")); EyouSoft.Model.CompanyStructure.CustomerInfo custModel = new EyouSoft.Model.CompanyStructure.CustomerInfo { Name = sname != -1 && custArr.Length >= sname ? custArr[sname] : "", Licence = slice != -1 && custArr.Length >= slice ? custArr[slice] : "", Adress = sadd != -1 && custArr.Length >= sadd ? custArr[sadd] : "", PostalCode = scode != -1 && custArr.Length >= scode ? custArr[scode] : "", ContactName = scon != -1 && custArr.Length >= scon ? custArr[scon] : "", Phone = stel != -1 && custArr.Length >= stel ? custArr[stel] : "", Mobile = smob != -1 && custArr.Length >= smob ? custArr[smob] : "", Fax = sfax != -1 && custArr.Length >= sfax ? custArr[sfax] : "", IsDelete = false, IsEnable = true, //Name = custArr[0], //Licence = custArr[1], //Adress = custArr[2], //PostalCode = custArr[3], //ContactName = custArr[5], //Phone = custArr[6], //Mobile = custArr[7], //Fax = custArr[4], //IsDelete = false, //IsEnable = true, CompanyId = CurrentUserCompanyID }; custList.Add(custModel); } result = custBll.AddCustomerMore(custList); } Utils.ResponseMeg(result, result ? "导入成功!" : "导入失败!"); return; #endregion } }
/// <summary> /// 初始化方法 /// </summary> void BindXC() { string tourId = Utils.GetQueryStringValue("tourId"); if (tourId == "") { Response.Write("未找到信息!"); return; } //声明bll对象 EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); //声明散拼计划对象 EyouSoft.Model.TourStructure.TourInfo model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(tourId); if (model != null) { //设置出团时间 xcTime = model.LDate; //发送专线 this.txtFromCompany.Text = SiteUserInfo.CompanyName; this.txtCompany.Text = SiteUserInfo.CompanyName; if (SiteUserInfo.ContactInfo != null) { //联系人姓名 this.txtFromName.Text = SiteUserInfo.ContactInfo.ContactName; //联系人传真 this.txtFromFax.Text = SiteUserInfo.ContactInfo.ContactFax; //联系人电话 this.txtFromTel.Text = SiteUserInfo.ContactInfo.ContactTel; this.txtContactTel.Text = SiteUserInfo.ContactInfo.ContactTel; } //线路名称 this.txtAreaName.Text = model.RouteName; //天数 this.txtDayCount.Text = model.TourDays.ToString(); //出发交通 this.txtLTraffic.Text = model.LTraffic; //返程交通 this.txtRTraffic.Text = model.RTraffic; //人数 //this.txtPeopleCount.Text = model.PlanPeopleNumber.ToString(); //设置游客信息 IList <EyouSoft.Model.TourStructure.TourOrderCustomer> customerList = new EyouSoft.BLL.TourStructure.TourOrder().GetTravellers(tourId).Where(x => x.CustomerStatus == EyouSoft.Model.EnumType.TourStructure.CustomerStatus.正常).ToList(); ; if (customerList != null && customerList.Count > 0) { visitorRowsCount = customerList.Count; //绑定旅客列表 this.rptCustomerList.DataSource = customerList; this.rptCustomerList.DataBind(); } //获取订单信息 EyouSoft.Model.TourStructure.TourOrder orderModel = new EyouSoft.BLL.TourStructure.TourOrder().GetOrderModel(SiteUserInfo.CompanyID, Utils.GetQueryStringValue("orderId")); int buyCompanyID = orderModel.BuyCompanyID; #region 接收方信息 EyouSoft.Model.CompanyStructure.CustomerInfo cModel = new EyouSoft.Model.CompanyStructure.CustomerInfo(); EyouSoft.BLL.CompanyStructure.Customer cBLL = new EyouSoft.BLL.CompanyStructure.Customer(); cModel = cBLL.GetCustomerModel(buyCompanyID); txtToCompany.Text = cModel.Name; txtToName.Text = cModel.ContactName; txtToFax.Text = cModel.Fax; txtToTel.Text = cModel.Phone; #endregion //标准版 if (model.ReleaseType == EyouSoft.Model.EnumType.TourStructure.ReleaseType.Normal) { //隐藏快速版行程安排 this.tblXCFast.Visible = false; //隐藏快速版服务标准 this.tblFastService.Visible = false; if (model.SentPeoples != null && model.SentPeoples.Count > 0) { //送团人信息 for (int i = 0; i < model.SentPeoples.Count; i++) { EyouSoft.Model.CompanyStructure.CompanyUser SendUserInfo = new EyouSoft.BLL.CompanyStructure.CompanyUser().GetUserInfo(model.SentPeoples[i].OperatorId); if (SendUserInfo != null) { //送团人 this.txtSendMan.Text += SendUserInfo.PersonInfo.ContactName == null ? "" : SendUserInfo.PersonInfo.ContactName + ","; //送团电话 this.txtSendTel.Text += SendUserInfo.PersonInfo == null ? "" : SendUserInfo.PersonInfo.ContactTel + ","; } } this.txtSendMan.Text = this.txtSendMan.Text.TrimEnd(','); this.txtSendTel.Text = this.txtSendTel.Text.TrimEnd(','); } if (model.TourNormalInfo != null) { //行程安排 this.xc_list.DataSource = model.TourNormalInfo.Plans; this.xc_list.DataBind(); //包含项目 this.rptProject.DataSource = model.TourNormalInfo.Services; this.rptProject.DataBind(); //不包含项目 this.lblNoPriject.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.BuHanXiangMu); //儿童安排 this.lblChildren.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.ErTongAnPai); //购物安排 this.lblShop.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.GouWuAnPai); //赠送项目 this.lblZiFei.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.ZiFeiXIangMu); //注意事项 this.lblZhuyi.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.ZhuYiShiXiang); //温馨提醒 this.lblTiXing.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.WenXinTiXing); } //获得报价说明 if (Utils.GetQueryStringValue("orderId") != "") { //EyouSoft.Model.TourStructure.TourOrder orderModel = new EyouSoft.BLL.TourStructure.TourOrder().GetOrderModel(SiteUserInfo.CompanyID, Utils.GetQueryStringValue("orderId")); if (orderModel != null) { //成人价格 this.lblManPrice.Text = EyouSoft.Common.Utils.FilterEndOfTheZeroString(orderModel.PersonalPrice.ToString("0.00")); //成人数 this.lblManCount.Text = orderModel.AdultNumber.ToString(); //儿童价格 this.lblChildPrice.Text = EyouSoft.Common.Utils.FilterEndOfTheZeroString(orderModel.ChildPrice.ToString("0.00")); //儿童数 this.lblChildCount.Text = orderModel.ChildNumber.ToString(); this.txtPeopleCount.Text = (orderModel.AdultNumber + orderModel.ChildNumber).ToString(); //总价格 this.lblAllPrice.Text = EyouSoft.Common.Utils.FilterEndOfTheZeroString(orderModel.SumPrice.ToString("0.00")); } else { //成人价格 this.lblManPrice.Text = "0"; //成人数 this.lblManCount.Text = "0"; //儿童价格 this.lblChildPrice.Text = "0"; //儿童数 this.lblChildCount.Text = "0"; //总价格 this.lblAllPrice.Text = "0"; } } else { //成人价格 this.lblManPrice.Text = "0"; //成人数 this.lblManCount.Text = "0"; //儿童价格 this.lblChildPrice.Text = "0"; //儿童数 this.lblChildCount.Text = "0"; //总价格 this.lblAllPrice.Text = "0"; } } //快速版 else { this.txtPeopleCount.Text = (orderModel.AdultNumber + orderModel.ChildNumber).ToString(); //隐藏标准版 行程安排 this.tblXingCheng.Visible = false; //隐藏标准版 服务 this.tblNoService.Visible = false; if (model.TourQuickInfo != null) { //设置行程安排 this.lclXingCheng.Text = model.TourQuickInfo.QuickPlan; //设置服务标准 this.lclService.Text = model.TourQuickInfo.Service; } } } EyouSoft.Model.CompanyStructure.CompanyInfo infoModel = new EyouSoft.BLL.CompanyStructure.CompanyInfo().GetModel(SiteUserInfo.CompanyID, SiteUserInfo.SysId); if (infoModel != null) { EyouSoft.Model.CompanyStructure.CompanyAccount account = null;//公司账户 if (infoModel.CompanyAccountList != null && infoModel.CompanyAccountList.Count > 0) { account = infoModel.CompanyAccountList[0]; this.lblCompanyName.Text = SiteUserInfo.CompanyName; this.lblBankName.Text = account.BankName; this.lblBankNum.Text = account.BankNo; this.lblBankUserName.Text = account.AccountName; } } }
protected void LinkButton1_Click(object sender, EventArgs e) { LinkButton btn = sender as LinkButton; EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(Request.QueryString["tourId"]); if (model != null) { if (!Utils.PlanIsUpdateOrDelete(model.Status.ToString())) { Response.Write("<script>alert('该团已提交财务,不能对它操作!');location.href=location.href;</script>"); return; } } //结算标准 string jsbj = Request.Form["radio"]; int cr_num = Utils.GetInt(txt_crNum.Value); int et_num = Utils.GetInt(txt_rtNum.Value); decimal sum_money = Utils.GetDecimal(txt_sumMoney.Value); string special = txt_Special.Value; //散拼信息 //EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(); //model = (EyouSoft.Model.TourStructure.TourInfo)bll.GetTourInfo(Request.QueryString["tourId"]); //model.PriceStandards EyouSoft.BLL.TourStructure.TourOrder orderbll = new EyouSoft.BLL.TourStructure.TourOrder(); EyouSoft.Model.TourStructure.TourOrder ordermodel = new EyouSoft.Model.TourStructure.TourOrder(); int crNum = Utils.GetInt(txt_crNum.Value); if (crNum == 0) { EyouSoft.Common.Function.MessageBox.Show(this.Page, "请填写成人数!"); BindXlInfo(); BindPireList(); return; } ordermodel.AdultNumber = crNum; ordermodel.AreaId = model.AreaId; int teamId = Utils.GetInt(Utils.GetFormValue("hd_teamId")); if (teamId == 0) { EyouSoft.Common.Function.MessageBox.Show(this.Page, "请选择组团社!"); BindXlInfo(); BindPireList(); return; //Response.Write("<script>alert('请选择组团社');location.href=location.href;</script>"); } ordermodel.BuyCompanyID = teamId; ordermodel.BuyCompanyName = Utils.GetFormValue("txt_teamName"); ordermodel.ChildNumber = Utils.GetInt(txt_rtNum.Value); ordermodel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price")); int cusLevel = Utils.GetInt(Utils.GetFormValue("hd_cuslevel")); if (cusLevel == 0) { EyouSoft.Common.Function.MessageBox.Show(this.Page, "请选择客户等级!"); BindXlInfo(); BindPireList(); return; } ordermodel.CustomerLevId = cusLevel; IList <EyouSoft.Model.TourStructure.TourOrderCustomer> cus_list = new List <EyouSoft.Model.TourStructure.TourOrderCustomer>(); string[] cus_arr = Utils.GetFormValues("txtVisitorName"); string[] uri = Utils.GetFormValues("tefu"); string[] cradType = Utils.GetFormValues("ddlCardType"); decimal orderprice = 0; for (int k = 0; k < cus_arr.Length; k++) { if (cus_arr[k] == "") { break; } EyouSoft.Model.TourStructure.TourOrderCustomer item = new EyouSoft.Model.TourStructure.TourOrderCustomer(); item.VisitorName = cus_arr[k]; item.VisitorType = Utils.GetFormValues("ddlVisitorType")[k] == "1" ? EyouSoft.Model.EnumType.TourStructure.VisitorType.成人 : EyouSoft.Model.EnumType.TourStructure.VisitorType.儿童; //switch (Utils.GetFormValues("ddlCardType")[k]) //{ // case "1": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.身份证; // } break; // case "2": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.护照; // } break; // case "3": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.军官证; // } break; // case "4": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.台胞证; // } break; // case "5": // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.港澳通行证; // } break; // default: // { // item.CradType = EyouSoft.Model.EnumType.TourStructure.CradType.未知; // } break; //} item.CradType = (EyouSoft.Model.EnumType.TourStructure.CradType)Utils.GetInt(cradType[k]); item.CradNumber = Utils.GetFormValues("txtCardNo")[k]; switch (Utils.GetFormValues("ddlSex")[k]) { case "2": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.男; } break; case "1": { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.女; } break; default: { item.Sex = EyouSoft.Model.EnumType.CompanyStructure.Sex.未知; } break; } item.ContactTel = Utils.GetFormValues("txtContactTel")[k]; EyouSoft.Model.TourStructure.CustomerSpecialService css = new EyouSoft.Model.TourStructure.CustomerSpecialService(); css.Fee = Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); css.IsAdd = Utils.GetFromQueryStringByKey(uri[k], "ddlOperate") == "0" ? true : false; css.IssueTime = DateTime.Now; css.ProjectName = Utils.GetFromQueryStringByKey(uri[k], "txtItem"); css.ServiceDetail = Utils.GetFromQueryStringByKey(uri[k], "txtServiceContent"); item.SpecialServiceInfo = css; item.IssueTime = DateTime.Now; item.CompanyID = CurrentUserCompanyID; cus_list.Add(item); orderprice += Utils.GetDecimal(Utils.GetFromQueryStringByKey(uri[k], "txtCost")); } ordermodel.IssueTime = DateTime.Now; ordermodel.OperatorContent = Utils.GetFormValue("txt_actMsg"); ordermodel.SpecialContent = Utils.GetFormValue("txt_Special"); ordermodel.CustomerList = cus_list; ordermodel.LastDate = DateTime.Now; ordermodel.LeaveDate = model.LDate; ordermodel.PriceStandId = Utils.GetInt(Utils.GetFormValue("hd_level")); ordermodel.PersonalPrice = Utils.GetDecimal(Utils.GetFormValue("hd_cr_price")); ordermodel.ChildPrice = Utils.GetDecimal(Utils.GetFormValue("hd_rt_price")); ordermodel.ID = Guid.NewGuid().ToString(); ordermodel.CustomerList = cus_list; ordermodel.TourId = model.TourId; ordermodel.OrderType = EyouSoft.Model.EnumType.TourStructure.OrderType.代客预定; ordermodel.SellCompanyId = CurrentUserCompanyID; ordermodel.SellCompanyName = SiteUserInfo.CompanyName; ordermodel.ViewOperatorId = SiteUserInfo.ID; ordermodel.TourNo = model.TourCode; ordermodel.Tourdays = model.TourDays; ordermodel.TourClassId = EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划; ordermodel.OperatorID = SiteUserInfo.ID; ordermodel.OperatorName = SiteUserInfo.ContactInfo.ContactName; ordermodel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理; ordermodel.OtherPrice = orderprice; ordermodel.RouteId = model.RouteId; ordermodel.RouteName = model.RouteName; ordermodel.SumPrice = Utils.GetDecimal(Utils.GetFormValue(txt_sumMoney.UniqueID)) + orderprice; ordermodel.PeopleNumber = Utils.GetInt(Utils.GetFormValue("txt_crNum")) + Utils.GetInt(Utils.GetFormValue("txt_rtNum")); ordermodel.ContactTel = lt_phone.Text; ordermodel.ContactName = lb_username.Text; ordermodel.ContactMobile = lt_tel.Text; ordermodel.LeaveTraffic = lt_startBus.Text; ordermodel.ReturnTraffic = lt_backBus.Text; ordermodel.ContactFax = lt_fax.Text; EyouSoft.BLL.CompanyStructure.Customer csbll = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CustomerInfo cusmodel = csbll.GetCustomerModel(Utils.GetInt(Utils.GetFormValue("hd_teamId"))); // EyouSoft.Model.TourStructure.TourOrderAmountPlusInfo am = new EyouSoft.Model.TourStructure.TourOrderAmountPlusInfo(); am.AddAmount = Utils.GetDecimal(Utils.GetFormValue("txt_addmoney")); //增加费用 am.ReduceAmount = Utils.GetDecimal(Utils.GetFormValue("txt_minusmoney")); //减少费用 am.Remark = Utils.GetFormValue("txt_remark"); //备注 ordermodel.AmountPlus = am; if (cusmodel != null) { ordermodel.SalerId = cusmodel.SaleId; ordermodel.SalerName = cusmodel.Saler; } #region 返佣和对方操作员 ordermodel.BuyerContactId = Utils.GetInt(Utils.GetFormValue("otherOprator")); ordermodel.BuyerContactName = Utils.InputText(Utils.GetFormValue("hd_orderOprator")); ordermodel.CommissionType = (EyouSoft.Model.EnumType.CompanyStructure.CommissionType)Utils.GetInt(Utils.GetFormValue("hd_rebateType")); ordermodel.CommissionPrice = Utils.GetDecimal(Utils.GetFormValue("txt_Rebate")); #endregion switch (btn.CommandName) { ///提交 case "submit": { ordermodel.SaveSeatDate = DateTime.Now; ordermodel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.未处理; } break; case "Reservations": { ordermodel.OrderState = EyouSoft.Model.EnumType.TourStructure.OrderState.已留位; ordermodel.SaveSeatDate = Utils.GetDateTime(txtEndTime.Text, DateTime.Now); } break; //留位 } string fileAtt = ""; string oldfileAtt = ""; if (EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files[0], "VisitorInfoFile", out fileAtt, out oldfileAtt)) { ordermodel.CustomerFilePath = fileAtt; } else { EyouSoft.Common.Function.MessageBox.Show(this.Page, "上传附件失败!"); return; } ordermodel.BuyerTourCode = Utils.GetFormValue(txtBuyerTourCode.ClientID); ordermodel.OrderTrafficId = Utils.GetInt(Utils.GetFormValue("selectTraffic")); /// 0:失败; /// 1:成功; /// 2:该团队的订单总人数+当前订单人数大于团队计划人数总和; /// 3:该客户所欠金额大于最高欠款金额; int i = orderbll.AddOrder(ordermodel); switch (i) { case 1: { Response.Write("<script>alert('提交成功');parent.Boxy.getIframeDialog('" + Request.QueryString["iframeid"] + "').hide();parent.location.href=parent.location.href;</script>"); } break; case 2: { Response.Write("<script>alert('该团队的订单总人数+当前订单人数大于团队计划人数总和');location.href=location.href;</script>"); } break; case 3: { Response.Write("<script>alert('该客户所欠金额大于最高欠款金额');location.href=location.href;</script>"); } break; case 4: { Response.Write("<script>alert('订单人数加上交通出团日期当天已使用票数大于交通出团日期当天人数,添加失败!');location.href=location.href;</script>"); break; } default: { Response.Write("<script>alert('添加失败!');location.href=location.href;</script>"); } break; } }
/// <summary> /// 按指定条件获取客户资料信息集合 /// </summary> /// <param name="companyId">公司(专线)编号</param> /// <param name="pageSize">每页记录数</param> /// <param name="pageIndex">当前页索引</param> /// <param name="recordCount">总记录数</param> /// <param name="seachInfo">查询条件业务实体</param> /// <returns></returns> public IList <EyouSoft.Model.CompanyStructure.CustomerInfo> GetCustomers(int companyId, int pageSize, int pageIndex, ref int recordCount, EyouSoft.Model.CompanyStructure.MCustomerSoldStatSearchInfo seachInfo) { IList <EyouSoft.Model.CompanyStructure.CustomerInfo> items = new List <EyouSoft.Model.CompanyStructure.CustomerInfo>(); StringBuilder cmdQuery = new StringBuilder(); string tableName = String.Format("select Id,ProvinceName,CityId,CityName,[Name],Saler,SaleId,ContactName,Phone,Mobile,Fax,CompanyId,IsNull((select sum(O.PeopleNumber-O.LeaguePepoleNum) from tbl_TourOrder AS O INNER JOIN tbl_Tour AS T ON O.TourId = T.TourId where T.CompanyId = {0} AND (T.TourType in (0,1)) And T.IsDelete= 0 And O.IsDelete = 0 AND O.BuyCompanyID=tbl_Customer.Id AND O.OrderState=5),0) AS TradeNum,IsNull((select sum(O.PeopleNumber-O.LeaguePepoleNum) from tbl_TourOrder AS O INNER JOIN tbl_Tour AS T ON O.TourId = T.TourId where T.CompanyId = {0} AND (T.TourType=0) AND T.IsDelete= 0 And O.IsDelete = 0 AND O.BuyCompanyID=tbl_Customer.Id AND O.OrderState=5),0) AS TradeTourNum from tbl_Customer WHERE Companyid={0} AND IsDelete='0'", companyId); bool IsGroupBy = false; string orderByString = "TradeNum DESC"; string fields = "*"; #region 拼接查询条件 cmdQuery.Append(" (1=1)"); if (seachInfo != null) { //出团日期 if (seachInfo.TourStartDate.HasValue || seachInfo.TourEndDate.HasValue || seachInfo.AreaId.HasValue) { //出团日期查询 string tmpTourLeaveDateSearchPara = String.Empty; if (seachInfo.TourStartDate.HasValue) { tmpTourLeaveDateSearchPara = " and (T.LeaveDate > '" + seachInfo.TourStartDate.Value.AddDays(-1) + "') "; } if (seachInfo.TourEndDate.HasValue) { tmpTourLeaveDateSearchPara += " and (T.LeaveDate < '" + seachInfo.TourEndDate.Value.AddDays(1) + "') "; } if (seachInfo.AreaId.HasValue) { tmpTourLeaveDateSearchPara += " AND (T.AreaId=" + seachInfo.AreaId.Value + ") "; } tableName = String.Format("select Id,ProvinceName,CityId,CityName,[Name],Saler,SaleId,ContactName,Phone,Mobile,Fax,CompanyId,IsNull((SELECT sum(O.PeopleNumber-O.LeaguePepoleNum) FROM tbl_TourOrder AS O INNER JOIN tbl_Tour AS T ON O.TourId = T.TourId WHERE T.CompanyId = {0} AND (T.TourType in (0,1)) AND T.IsDelete= 0 And O.IsDelete = 0 AND O.BuyCompanyID=tbl_Customer.Id AND O.OrderState=5 {1}),0) as TradeNum,IsNull((SELECT sum(O.PeopleNumber-O.LeaguePepoleNum) FROM tbl_TourOrder AS O INNER JOIN tbl_Tour AS T ON O.TourId = T.TourId WHERE T.CompanyId = {0} AND (T.TourType=0) AND T.IsDelete= 0 And O.IsDelete = 0 AND O.BuyCompanyID=tbl_Customer.Id AND O.OrderState=5 {2}),0) AS TradeTourNum from tbl_Customer WHERE Companyid={0} AND IsDelete='0'", companyId, tmpTourLeaveDateSearchPara, tmpTourLeaveDateSearchPara); cmdQuery.Append(" AND (Id in (select O.BuyCompanyID From tbl_TourOrder O,tbl_Tour T WHERE O.TourId = T.TourId " + tmpTourLeaveDateSearchPara + "))"); } if (seachInfo.CityIdList != null && seachInfo.CityIdList.Length > 0) { string CityIdList = ""; for (int i = 0; i < seachInfo.CityIdList.Length; i++) { CityIdList = CityIdList + seachInfo.CityIdList[i].ToString() + ','; } CityIdList = CityIdList.Trim(','); cmdQuery.AppendFormat(" AND CityId in ({0}) ", CityIdList); } if (seachInfo.CustomerId.HasValue) { cmdQuery.AppendFormat(" AND Id = {0} ", seachInfo.CustomerId.Value); } if (!string.IsNullOrEmpty(seachInfo.SellerName)) { cmdQuery.AppendFormat(" AND Saler LIKE '%{0}%' ", seachInfo.SellerName); } if (seachInfo.SellerIds != null && seachInfo.SellerIds.Length > 0) { cmdQuery.AppendFormat(" AND SaleId IN({0}) ", EyouSoft.Toolkit.Utils.GetSqlIdStrByArray(seachInfo.SellerIds)); } if (!string.IsNullOrEmpty(seachInfo.Mobile)) { cmdQuery.AppendFormat(" AND Mobile LIKE '%{0}%' ", seachInfo.Mobile); } if (seachInfo.DeptIds != null && seachInfo.DeptIds.Length > 0 && (seachInfo.SellerIds == null || seachInfo.SellerIds.Length == 0)) { cmdQuery.AppendFormat(" AND EXISTS(SELECT 1 FROM tbl_CompanyUser WHERE Id=SaleId AND DepartId IN({0}) ) ", EyouSoft.Toolkit.Utils.GetSqlIdStrByArray(seachInfo.DeptIds)); } //交易数比较 switch (seachInfo.SearchCompare) { case EyouSoft.Model.EnumType.FinanceStructure.QueryOperator.大于等于: cmdQuery.AppendFormat(" AND TradeNum > {0} ", seachInfo.SendTourPeopleNumber - 1); break; case EyouSoft.Model.EnumType.FinanceStructure.QueryOperator.等于: cmdQuery.AppendFormat(" AND TradeNum = {0} ", seachInfo.SendTourPeopleNumber); break; case EyouSoft.Model.EnumType.FinanceStructure.QueryOperator.小于等于: cmdQuery.AppendFormat(" AND TradeNum < {0} ", seachInfo.SendTourPeopleNumber + 1); break; } switch (seachInfo.XSTJFXOrderByType) { case 0: orderByString = "TradeNum DESC"; break; case 1: orderByString = "TradeNum ASC"; break; case 2: orderByString = "TradeTourNum DESC"; break; case 3: orderByString = "TradeTourNum ASC"; break; case 4: orderByString = "TradeNum-TradeTourNum DESC"; break; case 5: orderByString = "TradeNum-TradeTourNum ASC"; break; default: orderByString = "TradeNum DESC"; break; } } #endregion using (IDataReader rdr = DbHelper.ExecuteReaderBySqlTbl(this._db, pageSize, pageIndex, ref recordCount, tableName, fields, cmdQuery.ToString(), orderByString, IsGroupBy)) { while (rdr.Read()) { EyouSoft.Model.CompanyStructure.CustomerInfo item = new EyouSoft.Model.CompanyStructure.CustomerInfo(); item.CityName = rdr.IsDBNull(rdr.GetOrdinal("CityName")) ? "" : rdr["CityName"].ToString(); item.CompanyId = rdr.GetInt32(rdr.GetOrdinal("CompanyId")); item.ContactName = rdr.IsDBNull(rdr.GetOrdinal("ContactName")) ? "" : rdr["ContactName"].ToString(); item.Fax = rdr.IsDBNull(rdr.GetOrdinal("Fax")) ? "" : rdr["Fax"].ToString(); item.Id = rdr.GetInt32(rdr.GetOrdinal("Id")); item.Mobile = rdr.IsDBNull(rdr.GetOrdinal("Mobile")) ? "" : rdr["Mobile"].ToString(); item.Name = rdr.IsDBNull(rdr.GetOrdinal("Name")) ? "" : rdr["Name"].ToString(); item.Phone = rdr.IsDBNull(rdr.GetOrdinal("Phone")) ? "" : rdr["Phone"].ToString(); item.ProvinceName = rdr.IsDBNull(rdr.GetOrdinal("ProvinceName")) ? "" : rdr["ProvinceName"].ToString(); item.SaleId = rdr.GetInt32(rdr.GetOrdinal("SaleId")); item.Saler = rdr.IsDBNull(rdr.GetOrdinal("Saler")) ? "" : rdr["Saler"].ToString(); item.TradeTourNum = rdr.GetInt32(rdr.GetOrdinal("TradeTourNum")); item.TradeNum = rdr.GetInt32(rdr.GetOrdinal("TradeNum")); items.Add(item); } } return(items); }
protected bool IsChecked1; //团队状态是4 #region 页面加载 protected void Page_Load(object sender, EventArgs e) { #region 拉框添加点击事件 ddlSupperlierList.Attributes.Add("onchange", "ChecklocaCustomer(this)"); #endregion #region 修改权限验证 if (!CheckGrant(TravelPermission.单项服务_单项服务_修改服务)) { Utils.ResponseNoPermit(TravelPermission.单项服务_单项服务_修改服务, true); return; } #endregion #region 配置 EyouSoft.BLL.CompanyStructure.CompanySetting setBll = new EyouSoft.BLL.CompanyStructure.CompanySetting(); //初始化bll EyouSoft.Model.CompanyStructure.CompanyFieldSetting set = setBll.GetSetting(CurrentUserCompanyID); //配置实体 hd_IsRequiredTraveller.Value = set.IsRequiredTraveller.ToString(); //游客是否允许为空配置 #endregion // 绑定项目类型 BindPriceItem(); if (Request.QueryString["EditId"] != null)//修改ID { EditId = Request.QueryString["EditId"]; } #region 新增权限验证 if (!CheckGrant(TravelPermission.单项服务_单项服务_新增服务)) { Utils.ResponseNoPermit(TravelPermission.单项服务_单项服务_新增服务, true); return; } #endregion EyouSoft.BLL.TourStructure.TourOrder tourOrderBll = new EyouSoft.BLL.TourStructure.TourOrder(this.SiteUserInfo); this.txtOrderNo.Value = tourOrderBll.CreateOrderNo(); if (!Page.IsPostBack) { #region 栏目权限验证 if (!CheckGrant(TravelPermission.单项服务_单项服务_栏目)) { Utils.ResponseNoPermit(TravelPermission.单项服务_单项服务_栏目, true); return; } #endregion LoadVisitors1.CurrentPageIframeId = Request.QueryString["iframeId"]; if (EditId != "") { EyouSoft.BLL.TourStructure.Tour tourBll = new EyouSoft.BLL.TourStructure.Tour(this.SiteUserInfo); EditModel = (EyouSoft.Model.TourStructure.TourSingleInfo)tourBll.GetTourInfo(EditId); if (EditModel == null) { Utils.ShowAndRedirect("未能找到您要修改的记录!", "/SingleServe/SingleServeList.aspx"); } IsUpdate = true; //确认修改操作 IsChecked = ((int)EditModel.Status) == 5; //判断团队状态是否核算结束 IsChecked1 = ((int)EditModel.Status) == 4; //判断团队状态是否是财务核算 #region 初始化表单值 txtContactName.Value = EditModel.ContacterName; //联系人 txtCustomerCompany.Value = EditModel.BuyerCName; //客户单位名称 this.TxtStartTime.Value = EditModel.LDate.ToString("yyyy-MM-dd"); //委托出团日期 this.txtTourCode.Value = EditModel.TourCode; //团号 this.hideOldTeamNum.Value = EditModel.TourCode; //团号 hfSelectCustId.Value = EditModel.BuyerCId.ToString(); //客户单位编号 selectOperator1.OperId = EditModel.SellerId.ToString(); //销售员编号 selectOperator1.OperName = EditModel.SellerName; //销售员名称 txtOrderNo.Value = EditModel.OrderCode; //订单号 txtPersonNum.Value = EditModel.PlanPeopleNumber.ToString(); txtTel.Value = EditModel.ContacterTelephone; //电话 txtTotalIncome.Value = Utils.FilterEndOfTheZeroDecimal(EditModel.TotalAmount); //合计收入 txtTotalOutlay.Value = Utils.FilterEndOfTheZeroDecimal(EditModel.TotalOutAmount); //合计支出 txtGrossProfit.Value = Utils.FilterEndOfTheZeroDecimal(EditModel.GrossProfit); //毛利 hfOBuyerId.Value = EditModel.BuyerCId.ToString(); #region 绑定游客信息 if (EditModel.Customers != null && EditModel.Customers.Count > 0) { StringBuilder VisitorBuilder = new StringBuilder(); VisitorBuilder.Append("["); foreach (var item in EditModel.Customers) { VisitorBuilder.Append("["); VisitorBuilder.AppendFormat("'{0}','{1}','{2}','{3}','{4}','{5}','{6}'", item.VisitorName, (int)item.VisitorType, (int)item.CradType, item.CradNumber, (int)item.Sex, item.ContactTel, FormatSpecialServe(item.SpecialServiceInfo), item.ID); VisitorBuilder.Append("],"); } VisitorBuilder.Append("]"); VisitorArr = VisitorBuilder.ToString().Substring(0, VisitorBuilder.Length - 2) + "]"; } else { VisitorArr = "[]"; } #endregion #region 客户要求 if (EditModel.Services != null && EditModel.Services.Count > 0) { GuestRequestJSON = Newtonsoft.Json.JsonConvert.SerializeObject(EditModel.Services); } else { GuestRequestJSON = "{}"; } #endregion #region 供应商安排 if (EditModel.Plans != null && EditModel.Plans.Count > 0) { SupplierJSON = Newtonsoft.Json.JsonConvert.SerializeObject(EditModel.Plans); } #endregion #region 附件信息 if (!string.IsNullOrEmpty(EditModel.CustomerFilePath)) { aFile.HRef = EditModel.CustomerFilePath; aFile.Target = "_blank"; hFileInfo.Value = EditModel.CustomerFilePath; } #endregion #endregion } } string type = Utils.GetQueryStringValue("type"); if (type == "getInfo") { int cid = Utils.GetInt(Utils.GetQueryStringValue("cid")); EyouSoft.BLL.CompanyStructure.Customer custBll = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CustomerInfo model = custBll.GetCustomerModel(cid); Response.Clear(); if (model != null) { Response.Write(model.ContactName + "|" + model.Phone); } else { Response.Write(" | "); } Response.End(); } }
/// <summary> /// 页面初始化方法 /// </summary> /// <param name="tourId"></param> private void DataInit(string tourId) { EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); EyouSoft.Model.TourStructure.TourBaseInfo model = bll.GetTourInfo(tourId); EyouSoft.Model.TourStructure.TourInfo infoModel = null; EyouSoft.Model.TourStructure.TourTeamInfo teamModel = null; if (model != null && model.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划) { infoModel = (EyouSoft.Model.TourStructure.TourInfo)model; } else { teamModel = (EyouSoft.Model.TourStructure.TourTeamInfo)model; } this.lblTourCode.Text = model.TourCode; this.lblAreaName.Text = model.RouteName; this.lblBenginDate.Text = model.LDate.ToString("yyyy-MM-dd"); this.lblEndDate.Text = model.RDate.ToString("yyyy-MM-dd"); #region 结算价 if (EyouSoft.Model.EnumType.TourStructure.TourType.团队计划 == model.TourType) { TourQuotePrint priantTQP = new TourQuotePrint(); string number = string.Empty; string money = string.Empty; priantTQP.getPepoleNum(SiteUserInfo.CompanyID, model.PlanPeopleNumber, teamModel.TourTeamUnit, ref number, ref money); this.lblCount.Text = number; } #endregion //this.lblCount.Text = model.PlanPeopleNumber.ToString(); this.lblTeamPrice.Text = Utils.FilterEndOfTheZeroString(model.TotalIncome.ToString("0.00")); this.lblMeter.Text = ""; //票务 this.lblTicket.Text = ""; //团 利 润 this.lblProfit.Text = Utils.FilterEndOfTheZeroString((model.TotalIncome + model.TotalOtherIncome - model.TotalExpenses - model.TotalOtherExpenses - model.DistributionAmount).ToString("0.00")); //备注 this.lblRemarks.Text = ""; //绑定旅客信息 List <EyouSoft.Model.TourStructure.TourOrder> lorder = new List <EyouSoft.Model.TourStructure.TourOrder>(); EyouSoft.Model.TourStructure.TourOrder customerList = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo).GetOrderModel (SiteUserInfo.CompanyID, orderId); if (customerList != null) { EyouSoft.BLL.CompanyStructure.Customer cinfo = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CustomerInfo cm = cinfo.GetCustomerModel(customerList.BuyCompanyID); if (cm != null) { customerList.BuyCompanyName = cm.Name; } lorder.Add(customerList); } this.rptCustomer.DataSource = lorder; this.rptCustomer.DataBind(); //获得该计划下的所有地接的集合 EyouSoft.BLL.PlanStruture.TravelAgency travelBll = new EyouSoft.BLL.PlanStruture.TravelAgency(); IList <EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo> travelList = travelBll.GetList(tourId); if (travelList != null && travelList.Count > 0) { rptDjPriceTDCount = travelList.Count * 2; } this.rptDjPrice.DataSource = travelList; this.rptDjPrice.DataBind(); //添加地接备注 if (travelList != null && travelList.Count > 0) { for (int i = 0; i < travelList.Count; i++) { this.lblRemarks.Text += travelList[i].Remark + "<br />"; } } //机票费列表 EyouSoft.BLL.PlanStruture.PlaneTicket ticketBll = new EyouSoft.BLL.PlanStruture.PlaneTicket(); IList <EyouSoft.Model.PlanStructure.MLBTicketApplyInfo> ticketList = ticketBll.GetTicketApplys(CurrentUserCompanyID, tourId); if (ticketList != null && ticketList.Count > 0) { rptTicketPriceTDCount = ticketList.Count * 3; } this.rptTicketPrice.DataSource = ticketList; this.rptTicketPrice.DataBind(); //添加机票备注 if (ticketList != null && ticketList.Count > 0) { for (int i = 0; i < ticketList.Count; i++) { this.lblRemarks.Text += ticketList[i].Remark; } } //获得计调信息 IList <string> coordList = new EyouSoft.BLL.TourStructure.Tour().GetTourCoordinators(tourId); if (coordList != null && coordList.Count > 0) { for (int i = 0; i < coordList.Count; i++) { this.lblMeter.Text += coordList[i] + "<br />"; } } //获得票务信息 IList <string> operatorList = new EyouSoft.BLL.PlanStruture.PlaneTicket().CustomerOperatorList(tourId); if (operatorList != null && operatorList.Count > 0) { for (int i = 0; i < operatorList.Count; i++) { this.lblTicket.Text += operatorList[i] + "<br />"; } } }
/// <summary> /// 页面初始化方法 /// </summary> /// <param name="travelId">行程单ID</param> protected void DataInit(string tourId) { //声明bll对象 EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo); //声明团队计划对象 EyouSoft.Model.TourStructure.TourBaseInfo model = bll.GetTourInfo(tourId); if (model != null && model.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.散拼计划) { this.Page.Title = "散拼结算明细单"; EyouSoft.Model.TourStructure.TourInfo teamModel = (EyouSoft.Model.TourStructure.TourInfo)model; //收款单位 this.txtBuyerCName.Text = teamModel.BuyerCName; EyouSoft.Model.CompanyStructure.CustomerInfo cusModel = new EyouSoft.BLL.CompanyStructure.Customer().GetCustomerModel(model.BuyerCId); if (cusModel != null) { //收款人 txtContact.Text = cusModel.ContactName; //电话 txtPbone.Text = cusModel.Phone; //传真 txtFax.Text = cusModel.Fax; } //线路 this.txtAreaName.Text = teamModel.RouteName; //人数 this.txtCount.Text = teamModel.PlanPeopleNumber.ToString(); //日期 this.txtDataTime.Text = DateTime.Now.ToString("yyyy-MM-dd"); //价格组成 tbMoney.Visible = false; tbMoneySP.Visible = true; EyouSoft.BLL.TourStructure.TourOrder tobll = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo); IList <EyouSoft.Model.TourStructure.TourOrder> lorder = new List <EyouSoft.Model.TourStructure.TourOrder>(); EyouSoft.Model.TourStructure.TourOrder orderModel = tobll.GetOrderModel(SiteUserInfo.CompanyID, orderId); if (orderModel != null) { lorder.Add(orderModel); EyouSoft.BLL.CompanyStructure.Customer cinfo = new EyouSoft.BLL.CompanyStructure.Customer(); EyouSoft.Model.CompanyStructure.CustomerInfo cm = cinfo.GetCustomerModel(orderModel.BuyCompanyID); if (cm != null) { txtBuyerCName.Text = cm.Name; } txtPbone.Text = orderModel.ContactTel; txtContact.Text = orderModel.ContactName; txtFax.Text = orderModel.ContactFax; rpt_orderList.DataSource = lorder; rpt_orderList.DataBind(); } //收入 IList <EyouSoft.Model.TourStructure.OrderFinanceExpense> fristList = new EyouSoft.BLL.TourStructure.TourOrder(SiteUserInfo).GetOrderList(SiteUserInfo.CompanyID, tourId); if (fristList != null && fristList.Count > 0) { allCount += fristList.Count; this.rptFrist.DataSource = fristList; this.rptFrist.DataBind(); } //其它收入 EyouSoft.Model.FinanceStructure.OtherCostQuery otherCostQueryModel = new EyouSoft.Model.FinanceStructure.OtherCostQuery(); otherCostQueryModel.TourId = tourId; IList <EyouSoft.Model.FinanceStructure.OtherIncomeInfo> secoundList = new EyouSoft.BLL.FinanceStructure.OtherCost(SiteUserInfo).GetOtherIncomeList(otherCostQueryModel); if (secoundList != null && secoundList.Count > 0) { allCount += secoundList.Count; this.rptSecound.DataSource = secoundList; this.rptSecound.DataBind(); } //支出 IList <EyouSoft.Model.PlanStructure.PaymentList> thirdList = new EyouSoft.BLL.PlanStruture.TravelAgency().GetSettleList(tourId); if (thirdList != null && thirdList.Count > 0) { allCount += thirdList.Count; this.rptThird.DataSource = thirdList; this.rptThird.DataBind(); } //其它支出 IList <EyouSoft.Model.FinanceStructure.OtherOutInfo> forthList = new EyouSoft.BLL.FinanceStructure.OtherCost(SiteUserInfo).GetOtherOutList(otherCostQueryModel); if (forthList != null && forthList.Count > 0) { allCount += forthList.Count; this.rptForth.DataSource = forthList; this.rptForth.DataBind(); } } }
/// <summary> /// 更新组团端客户资料数据 /// </summary> public bool UpdateSampleCustomer(EyouSoft.Model.CompanyStructure.CustomerInfo model) { return(Dal.UpdateSampleCustomer(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int AddCustomer(EyouSoft.Model.CompanyStructure.CustomerInfo model) { return(Dal.AddCustomer(model)); }
protected void InitBindCompany() { CustomerInfo = new EyouSoft.Model.CompanyStructure.CustomerInfo(); //省份 int Province = this.ProvinceList1.ProvinceId; //城市 int CityID = this.CityList1.CityId; //单位名称 string UnitsName = Utils.GetString(Utils.GetFormValue(Txt_UnitsName.UniqueID.Trim()), ""); if (Utils.InputText(UnitsName) == "") { MessageBox.Show(this, "请填写单位名称!"); return; } //许可证号 string LicenseNumber = Utils.GetString(Utils.GetFormValue(Txt_LicenseNumber.UniqueID), ""); //公司地址 string CompanyAddress = Utils.GetString(Utils.GetFormValue(Txt_CompanyAddress.UniqueID), ""); //邮编 string Code = Utils.GetString(Utils.GetFormValue(Txt_Code.UniqueID), ""); //银行账号 string AccountNumber = Utils.GetString(Utils.GetFormValue(Txt_AccountNumber.UniqueID), ""); //返佣类型 string ReBateType = Utils.GetString(Utils.GetFormValue(DDlReBateType.UniqueID), ""); //主要联系人 string Contact = Utils.GetString(Utils.GetFormValue(Txt_Contact.UniqueID), ""); if (Utils.InputText(Contact) == "") { MessageBox.Show(this, "请填写主要联系人!"); return; } //电话 string Tel = Utils.GetString(Utils.GetFormValue(Txt_Phone.UniqueID), ""); if (Utils.InputText(Tel) == "") { MessageBox.Show(this, "请填写联系电话号码!"); return; } //手机 string Moblie = Utils.GetString(Utils.GetFormValue(Txt_Mobile.UniqueID), ""); //传真 string Fox = Utils.GetString(Utils.GetFormValue(Txt_Fox.UniqueID), ""); //备注 string Remirke = Utils.GetString(Utils.GetFormValue(Txt_Remirke.UniqueID), ""); CustomerInfo.ProviceId = Province; CustomerInfo.CityId = CityID; CustomerInfo.Name = UnitsName; CustomerInfo.Licence = LicenseNumber; CustomerInfo.Adress = CompanyAddress; CustomerInfo.PostalCode = Code; CustomerInfo.BankAccount = AccountNumber; CustomerInfo.CommissionType = (EyouSoft.Model.EnumType.CompanyStructure.CommissionType)Enum.Parse(typeof(EyouSoft.Model.EnumType.CompanyStructure.CommissionType), ReBateType); CustomerInfo.ContactName = Contact; CustomerInfo.Phone = Tel; CustomerInfo.Mobile = Moblie; CustomerInfo.Fax = Fox; CustomerInfo.Remark = Remirke; CustomerInfo.Id = SiteUserInfo.TourCompany.TourCompanyId; //更新组团端公司信息 if (Customer.UpdateSampleCustomer(CustomerInfo)) { SetErrorMsg(true, "公司信息设置成功!", "/GroupEnd/SystemSetting/CompanyInfo.aspx"); } else { SetErrorMsg(false, "公司信息设置失败!", "/GroupEnd/SystemSetting/CompanyInfo.aspx"); } }
protected bool IsStartState = true; //当前账户是否是停用状态 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.AccountDaylist.Items.Clear(); string[] intarry = new string[32]; for (int i = 0; i < 32; i++) { if (i == 0) { intarry[0] = "请选择"; } else { intarry[i] = (i).ToString(); } } if (intarry != null && intarry.Length > 0) { this.AccountDaylist.DataSource = intarry; this.AccountDaylist.DataBind(); } } #region 设置公司ID初始化省份城市列表 ucProvince1.CompanyId = CurrentUserCompanyID; ucProvince1.IsFav = true; ucCity1.CompanyId = CurrentUserCompanyID; ucCity1.IsFav = true; #endregion EyouSoft.BLL.CompanyStructure.Customer custBll = new EyouSoft.BLL.CompanyStructure.Customer(); //客户资料bll EyouSoft.Model.CompanyStructure.CustomerInfo custModel = null; //客户资料实体 string method = Utils.GetFormValue("hidMethod"); //当前操作 int custId = Utils.GetInt(Utils.GetQueryStringValue("custId")); //客户Id string type = Utils.GetQueryStringValue("type"); if (type == "show") { isshow = true; } EyouSoft.BLL.CompanyStructure.CompanyUser user = new EyouSoft.BLL.CompanyStructure.CompanyUser(); if (method == "save") { #region 保存客户资料 custModel = new EyouSoft.Model.CompanyStructure.CustomerInfo(); custModel.Name = Utils.InputText(txtCompany.Value); //单位名称 custModel.Licence = Utils.InputText(txtLicense.Value); //许可证号 custModel.Adress = Utils.InputText(txtAddress.Value); //地址 custModel.PostalCode = Utils.InputText(txtPostalCode.Value); //邮编 custModel.BankAccount = Utils.InputText(txtBankCode.Value); //银行账号 custModel.PreDeposit = Utils.GetDecimal(Utils.InputText(txtBeforeMoney.Value)); //预存款 custModel.MaxDebts = Utils.GetDecimal(Utils.InputText(txtArrears.Value)); //最高欠款 custModel.CommissionType = (EyouSoft.Model.EnumType.CompanyStructure.CommissionType)Utils.GetInt(Utils.InputText(rdiBackType.SelectedValue)); //反佣类型 custModel.CommissionCount = Utils.GetDecimal(Utils.InputText(txtBackMoney.Value)); //反佣金额 custModel.CustomerLev = Utils.GetInt(Utils.GetFormValue(selCustLevel.UniqueID)); //客户等级 custModel.JieSuanType = (EyouSoft.Model.EnumType.CompanyStructure.KHJieSuanType)Utils.GetInt(ddl_checkType.SelectedValue); custModel.IsRequiredTourCode = rad_IsShowGroupNo.SelectedValue == "true" ? true : false; //ddl_checkType //结算日期 if (Utils.GetFormValue("AccountTypeRadio") == "1") { custModel.AccountDayType = EyouSoft.Model.EnumType.CompanyStructure.AccountDayType.Month; custModel.AccountDay = Utils.GetInt(Utils.GetFormValue(AccountDaylist.UniqueID)); } else { custModel.AccountDayType = EyouSoft.Model.EnumType.CompanyStructure.AccountDayType.Week; custModel.AccountDay = Utils.GetInt(Utils.GetFormValue("checkDay")); } custModel.AccountWay = Utils.InputText(Utils.GetFormValue(AccountType.UniqueID)); //结算方式 custModel.ContactName = Utils.InputText(txtMainContact.Value); //主要联系人 custModel.Phone = Utils.InputText(txtMainTel.Value); //电话 custModel.Mobile = Utils.InputText(txtMainMobile.Value); //手机 custModel.Fax = Utils.InputText(txtMainFax.Value); //传真 custModel.Remark = Utils.InputText(txtRemark.Value); //备注 custModel.ProviceId = this.ucProvince1.ProvinceId; custModel.CityId = this.ucCity1.CityId; custModel.ProvinceName = Utils.GetFormValue("pName"); if (custModel.ProvinceName == "请选择") { custModel.ProvinceName = ""; } custModel.CityName = Utils.GetFormValue("cName"); if (custModel.CityName == "请选择") { custModel.CityName = ""; } custModel.CompanyId = CurrentUserCompanyID; custModel.SaleId = Utils.GetInt(Utils.GetFormValue(selDutySaler.UniqueID)); custModel.Saler = Utils.GetFormValue("hidSaler"); custModel.IssueTime = DateTime.Now; custModel.IsEnable = true; custModel.IsDelete = false; custModel.BrandId = Utils.GetInt(Utils.GetFormValue(selBrand.UniqueID)); string showMess = "数据保存成功!"; string[] contactId = Utils.GetFormValues("contactId"); string[] custName = Utils.GetFormValues("txtContact"); //姓名 string[] custSex = Utils.GetFormValues("selSex"); //性别 string[] custDepart = Utils.GetFormValues("txtDepart"); //部门 string[] custBirth = Utils.GetFormValues("txtBirth"); //生日 string[] custDuty = Utils.GetFormValues("txtDuty"); //职务 string[] custMobile = Utils.GetFormValues("txtMobile"); //手机 string[] custTel = Utils.GetFormValues("txtTel"); //电话 string[] cusFax = Utils.GetFormValues("txtFax"); //传真 string[] custQQ = Utils.GetFormValues("txtQQ"); //QQ string[] custEmail = Utils.GetFormValues("txtEmail"); //用户邮箱 string[] custUserName = Utils.GetFormValues("txtUserName"); //用户名 string[] custUserId = Utils.GetFormValues("userId"); //用户ID string[] custPwd = Utils.GetFormValues("txtPwd"); //密码 string[] custPwdSure = Utils.GetFormValues("txtPwdSure"); //确认密码 string[] splitStr = new string[] { "|," }; string[] custAreaId = Utils.GetFormValue("custHidArea").Split(splitStr, StringSplitOptions.None); //线路区域 string[] custAreaName = Utils.GetFormValue("txtRouteArea").Split(splitStr, StringSplitOptions.None); //线路区域 IList <EyouSoft.Model.CompanyStructure.CustomerContactInfo> custList = new List <EyouSoft.Model.CompanyStructure.CustomerContactInfo>(); StringBuilder repartUserName = new StringBuilder(); for (int i = 0, len = custName.Length; i < len; i++) { if (i == 0 && string.IsNullOrEmpty(custName[i]) || custName[i] == "") { continue; } if (String.IsNullOrEmpty(custName[i])) { MessageBox.ShowAndRedirect(this, "请填写完整姓名!", this.Request.Url.ToString()); break; } if (custUserId[i] == "0") { if (user.IsExists(0, custUserName[i], CurrentUserCompanyID)) { repartUserName.AppendFormat("{0},", custUserName[i]); //continue; } } EyouSoft.Model.CompanyStructure.CustomerContactInfo custInfo = new EyouSoft.Model.CompanyStructure.CustomerContactInfo(); custInfo.BirthDay = Utils.GetDateTime(custBirth[i], DateTime.Now); custInfo.Department = custDepart[i]; custInfo.IsDelete = "0"; custInfo.Email = string.Empty; custInfo.Job = custDuty[i]; custInfo.Mobile = custMobile[i]; custInfo.Tel = custTel[i]; custInfo.Fax = cusFax[i]; custInfo.ID = Utils.GetInt(contactId[i]); custInfo.Name = custName[i]; custInfo.qq = custQQ[i]; custInfo.Sex = custSex[i]; custModel.IssueTime = DateTime.Now; if (!user.IsExists(Utils.GetInt(custUserId[i]), custUserName[i], CurrentUserCompanyID) || Utils.GetInt(custUserId[i]) != 0) { custInfo.UserAccount = new EyouSoft.Model.CompanyStructure.UserAccount(); custInfo.UserAccount.CompanyId = CurrentUserCompanyID; custInfo.UserAccount.UserName = custUserName[i]; custInfo.UserAccount.UserAreaList = new List <EyouSoft.Model.CompanyStructure.UserArea>(); string areaIds = custAreaId[i].Trim('|'); string areaNames = custAreaName[i].Trim('|'); custInfo.AreaIds = areaIds; custInfo.AreaNames = areaNames; custInfo.UserAccount.PassWordInfo = new EyouSoft.Model.CompanyStructure.PassWord { NoEncryptPassword = custPwd[i] }; } custList.Add(custInfo); } custModel.CustomerContactList = custList; string strRepeat = repartUserName.ToString().TrimEnd(','); bool result = false; int resultInt = 0; if (custId != 0) { //修改 custModel.Id = custId; resultInt = custBll.UpdateCustomer(custModel); result = resultInt == 1 || resultInt == 9; var splitStr2 = new string[] { "," }; string[] delIds = Utils.GetFormValue("delIds").Split(splitStr2, StringSplitOptions.RemoveEmptyEntries); if (delIds.Length > 0) { result = custBll.DeleteCustomerContacter(delIds); } } else { //添加 resultInt = custBll.AddCustomer(custModel); result = resultInt == 1 || resultInt == 9; } if (!result) { showMess = "数据保存失败"; } else { if (strRepeat != "") { showMess = strRepeat + "账户已经存在将不会添加!"; } } Utils.ShowMsgAndCloseBoxy(showMess, Utils.GetQueryStringValue("iframeId"), true); //MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.location='/CRM/customerinfos/CustomerList.aspx';window.parent.Boxy.getIframeDialog('{1}').hide()", showMess, Utils.GetQueryStringValue("iframeId"))); #endregion } else { #region 初始化加载客户资料 EyouSoft.BLL.CompanyStructure.CompanyBrand brandBll = new EyouSoft.BLL.CompanyStructure.CompanyBrand(); int recordCount = 0; //初始化绑定品牌列表 IList <EyouSoft.Model.CompanyStructure.CompanyBrand> listB = brandBll.GetList(100000, 1, ref recordCount, CurrentUserCompanyID); selBrand.DataTextField = "BrandName"; selBrand.DataValueField = "Id"; selBrand.DataSource = listB; selBrand.DataBind(); selBrand.Items.Insert(0, new ListItem("请选择", "")); //初始化绑定客户等级列表 EyouSoft.BLL.CompanyStructure.CompanyCustomStand customStandBll = new EyouSoft.BLL.CompanyStructure.CompanyCustomStand();//初始化custbll IList <EyouSoft.Model.CompanyStructure.CustomStand> list = customStandBll.GetList(100000, 1, ref recordCount, CurrentUserCompanyID); selCustLevel.DataTextField = "CustomStandName"; selCustLevel.DataValueField = "Id"; selCustLevel.DataSource = list; selCustLevel.DataBind(); selCustLevel.Items.Insert(0, new ListItem("请选择", "")); //初始化绑定部门员工列表 EyouSoft.BLL.CompanyStructure.CompanyUser userBll = new EyouSoft.BLL.CompanyStructure.CompanyUser(); IList <EyouSoft.Model.CompanyStructure.CompanyUser> userList = userBll.GetCompanyUser(CurrentUserCompanyID); if (userList != null && userList.Count > 0) { foreach (EyouSoft.Model.CompanyStructure.CompanyUser userItem in userList) { selDutySaler.Items.Add(new ListItem(userItem.PersonInfo.ContactName, userItem.ID.ToString())); } } selDutySaler.Items.Insert(0, new ListItem("请选择", "")); //判断是否有分配账号权限(隐藏或显示分配账号按钮) if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_分配帐号)) { hasAccountPermit = true; } if (custId != 0) { //初始化数据获取客户资料实体 custModel = custBll.GetCustomerModel(custId); if (custModel != null) { IsStartState = custModel.IsEnable; txtCompany.Value = custModel.Name; //单位名称 txtLicense.Value = custModel.Licence; //许可证号 txtAddress.Value = custModel.Adress; //地址 txtPostalCode.Value = custModel.PostalCode; //邮编 txtBankCode.Value = custModel.BankAccount; //银行账号 txtBeforeMoney.Value = custModel.PreDeposit.ToString("F2"); //预存款 txtArrears.Value = custModel.MaxDebts.ToString("F2"); //最高欠款 rdiBackType.SelectedValue = ((int)custModel.CommissionType).ToString(); //反佣类型 txtBackMoney.Value = custModel.CommissionCount.ToString("F2"); //反佣金额 selCustLevel.Value = custModel.CustomerLev.ToString(); //客户等级 ddl_checkType.SelectedValue = ((int)custModel.JieSuanType).ToString(); rad_IsShowGroupNo.SelectedValue = (bool)custModel.IsRequiredTourCode ? "true" : "false"; //结算日期 按周 if (custModel.AccountDayType == EyouSoft.Model.EnumType.CompanyStructure.AccountDayType.Week) { this.AccountTypeRadio1.Checked = false; this.AccountTypeRadio2.Checked = true; this.AccountDaylist.Attributes.Add("disabled", "disabled"); if (custModel.AccountDay != 0) { switch (custModel.AccountDay) { case 1: this.checkDay1.Checked = true; break; case 2: this.checkDay1.Checked = false; this.checkDay2.Checked = true; break; case 3: this.checkDay1.Checked = false; this.checkDay3.Checked = true; break; case 4: this.checkDay1.Checked = false; this.checkDay4.Checked = true; break; case 5: this.checkDay1.Checked = false; this.checkDay5.Checked = true; break; case 6: this.checkDay1.Checked = false; this.checkDay6.Checked = true; break; case 7: this.checkDay1.Checked = false; this.checkDay7.Checked = true; break; } } }//按每月X几 else { this.AccountTypeRadio1.Checked = true; this.AccountTypeRadio2.Checked = false; this.checkDay1.Attributes.Add("disabled", "disabled"); this.checkDay3.Attributes.Add("disabled", "disabled"); this.checkDay2.Attributes.Add("disabled", "disabled"); this.checkDay4.Attributes.Add("disabled", "disabled"); this.checkDay5.Attributes.Add("disabled", "disabled"); this.checkDay6.Attributes.Add("disabled", "disabled"); this.checkDay7.Attributes.Add("disabled", "disabled"); if (custModel.AccountDay != 0) { this.AccountDaylist.Items.FindByValue(custModel.AccountDay.ToString()).Selected = true; } } //结算方式 this.AccountType.Value = custModel.AccountWay; txtMainContact.Value = custModel.ContactName; //主要联系人 txtMainTel.Value = custModel.Phone; //电话 txtMainMobile.Value = custModel.Mobile; //手机 txtMainFax.Value = custModel.Fax; //传真 txtRemark.Value = custModel.Remark; //备注 selBrand.Value = custModel.BrandId.ToString(); //品牌 selDutySaler.Value = custModel.SaleId.ToString(); //责任销售 ucProvince1.ProvinceId = custModel.ProviceId; //省份 ucCity1.CityId = custModel.CityId; //城市 ucCity1.ProvinceId = custModel.ProviceId; //获取联系人集合 IList <EyouSoft.Model.CompanyStructure.CustomerContactInfo> custList = custModel.CustomerContactList; if (custList != null && custList.Count > 0) { GetContactHtml(custList); } //如果有修改权限则显示保存按钮 if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_修改客户)) { HasPermit = true; } } } else { //如果有新增权限则显示保存按钮 if (CheckGrant(global::Common.Enum.TravelPermission.客户关系管理_客户资料_新增客户)) { HasPermit = true; } } #endregion } }