Пример #1
0
        /// <summary>
        /// 修改保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected string UpdateData()
        {
            string  contactName   = Utils.GetFormValue(this.sup_txtContact.UniqueID);
            string  contactTel    = Utils.GetFormValue(this.sup_txtTel.UniqueID);
            decimal servicePrice  = Utils.GetDecimal(Utils.GetFormValue(this.sup_ServicePrice.UniqueID));
            string  workStartTime = Utils.GetFormValue(this.sup_BeginTime.UniqueID);
            string  workEndTime   = Utils.GetFormValue(this.sup_EndTime.UniqueID);
            decimal deliveryPrice = Utils.GetDecimal(Utils.GetFormValue(this.sup_txtPrice.UniqueID));

            if (String.IsNullOrEmpty(contactName))
            {
                return("联系人不能为空!");
            }
            if (!Utils.IsMobilePhone(contactTel))
            {
                return("请正确输入手机号码!");
            }
            if (servicePrice == 0)
            {
                //return "请正确输入服务价格!";
            }
            if (String.IsNullOrEmpty(workStartTime))
            {
                return("请输入上班时间!");
            }
            if (String.IsNullOrEmpty(workEndTime))
            {
                return("请输入下班时间!");
            }
            if (deliveryPrice == 0)
            {
                //return "请正确输入快递费!";
            }

            EyouSoft.Model.TicketStructure.TicketWholesalersInfo model = EyouSoft.BLL.TicketStructure.TicketSupplierInfo.CreateInstance().GetSupplierInfo(SiteUserInfo.CompanyID);
            if (model != null)
            {
                model.ContactName   = contactName;
                model.ContactTel    = contactTel;
                model.ServicePrice  = servicePrice;
                model.WorkStartTime = workStartTime;
                model.WorkEndTime   = workEndTime;
                model.DeliveryPrice = deliveryPrice;

                bool result = EyouSoft.BLL.TicketStructure.TicketSupplierInfo.CreateInstance().UpatetSupplierInfo(model);
                if (result)
                {
                    return("UpdateOk");
                }
                else
                {
                    return("error");
                }
            }
            return("error");
        }
Пример #2
0
        /// <summary>
        /// 根据供应商ID,获取出票成功率
        /// </summary>
        /// <param name="SupplierCId"></param>
        /// <returns></returns>
        protected decimal GetSuccessRate(string SupplierCId)
        {
            decimal SuccessRate = 0;

            EyouSoft.Model.TicketStructure.TicketWholesalersInfo model = EyouSoft.BLL.TicketStructure.TicketSupplierInfo.CreateInstance().GetSupplierInfo(SupplierCId);
            if (model != null)
            {
                SuccessRate = model.SuccessRate;
            }
            model = null;
            return(SuccessRate);
        }
Пример #3
0
 /// <summary>
 /// 数据初始化
 /// </summary>
 protected void DataInit()
 {
     EyouSoft.Model.TicketStructure.TicketWholesalersInfo model = EyouSoft.BLL.TicketStructure.TicketSupplierInfo.CreateInstance().GetSupplierInfo(SiteUserInfo.CompanyID);
     if (model != null)
     {
         this.sup_lblSuppliers.Text = SiteUserInfo.CompanyName;
         this.sup_txtContact.Text   = model.ContactName;
         this.sup_txtTel.Text       = model.ContactTel;
         this.sup_ServicePrice.Text = model.ServicePrice.ToString("0.00");
         this.sup_BeginTime.Text    = model.WorkStartTime;
         this.sup_EndTime.Text      = model.WorkEndTime;
         this.sup_txtPrice.Text     = model.DeliveryPrice.ToString("0.00");
     }
 }
Пример #4
0
        /// <summary>
        /// 修改供应商扩展信息
        /// </summary>
        /// <param name="model">供应商扩展信息实体</param>
        /// <returns>true:成功 false:失败</returns>
        public virtual bool Update(EyouSoft.Model.TicketStructure.TicketWholesalersInfo model)
        {
            DbCommand dc = this._database.GetSqlStringCommand(Sql_TicketWholesalersInfo_UPDATE + Sql_CompanyInfo_SetBasicInfo);

            this._database.AddInParameter(dc, "ProxyLev", DbType.String, model.ProxyLev);
            this._database.AddInParameter(dc, "ICPNumber", DbType.String, model.ICPNumber);
            this._database.AddInParameter(dc, "ServicePrice", DbType.Decimal, model.ServicePrice);
            this._database.AddInParameter(dc, "WorkStartTime", DbType.String, model.WorkStartTime);
            this._database.AddInParameter(dc, "WorkEndTime", DbType.String, model.WorkEndTime);
            this._database.AddInParameter(dc, "DeliveryPrice", DbType.Decimal, model.DeliveryPrice);
            this._database.AddInParameter(dc, "ContactName", DbType.String, model.ContactName);
            this._database.AddInParameter(dc, "ContactTel", DbType.String, model.ContactTel);
            this._database.AddInParameter(dc, "Remark", DbType.String, model.CompanyRemark);
            this._database.AddInParameter(dc, "WebSite", DbType.String, model.WebSite);
            this._database.AddInParameter(dc, "OfficeNumber", DbType.StringFixedLength, model.OfficeNumber);
            this._database.AddInParameter(dc, "CompanyId", DbType.AnsiStringFixedLength, model.CompanyId);
            return(DbHelper.ExecuteSql(dc, this._database) > 0 ? true : false);
        }
Пример #5
0
        /// <summary>
        /// 添加供应商扩展信息
        /// </summary>
        /// <param name="model">供应商扩展信息实体</param>
        /// <returns>true:成功 false:失败</returns>
        public virtual bool Add(EyouSoft.Model.TicketStructure.TicketWholesalersInfo model)
        {
            DbCommand dc = this._database.GetSqlStringCommand(Sql_TicketWholesalersInfo_Add);

            this._database.AddInParameter(dc, "CompanyId", DbType.String, model.CompanyId);
            this._database.AddInParameter(dc, "ContactName", DbType.String, model.ContactName);
            this._database.AddInParameter(dc, "ContactTel", DbType.String, model.ContactTel);
            this._database.AddInParameter(dc, "DeliveryPrice", DbType.Decimal, model.DeliveryPrice);
            this._database.AddInParameter(dc, "HandleNum", DbType.Int32, model.HandleNum);
            this._database.AddInParameter(dc, "ICPNumber", DbType.String, model.ICPNumber);
            this._database.AddInParameter(dc, "ProxyLev", DbType.String, model.ProxyLev);
            this._database.AddInParameter(dc, "ServicePrice", DbType.Decimal, model.ServicePrice);
            this._database.AddInParameter(dc, "SubmitNum", DbType.Int32, model.SubmitNum);
            this._database.AddInParameter(dc, "SuccessRate", DbType.Decimal, model.SuccessRate);
            this._database.AddInParameter(dc, "WorkEndTime", DbType.String, model.WorkEndTime);
            this._database.AddInParameter(dc, "WorkStartTime", DbType.String, model.WorkStartTime);
            this._database.AddInParameter(dc, "OfficeNumber", DbType.AnsiString, model.OfficeNumber);
            return(DbHelper.ExecuteSql(dc, this._database) > 0 ? true : false);
        }
Пример #6
0
 /// <summary>
 /// 获取完整的供应商实体
 /// </summary>
 /// <param name="CompanyId">公司ID</param>
 /// <returns></returns>
 public EyouSoft.Model.TicketStructure.TicketWholesalersAllInfo GetSupplierInfo(string CompanyId)
 {
     EyouSoft.Model.TicketStructure.TicketWholesalersInfo    ticketWholesalersInfoModel = idal.GetModel(CompanyId);
     EyouSoft.Model.CompanyStructure.CompanyDetailInfo       companyModel = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().GetModel(CompanyId);
     EyouSoft.Model.TicketStructure.TicketWholesalersAllInfo Model        = new EyouSoft.Model.TicketStructure.TicketWholesalersAllInfo();
     if (ticketWholesalersInfoModel != null)
     {
         Model.CompanyId = ticketWholesalersInfoModel.CompanyId;
         Model.ProxyLev  = ticketWholesalersInfoModel.ProxyLev;
         //Model.SuccessRate = ticketWholesalersInfoModel.SuccessRate;
         Model.ICPNumber       = ticketWholesalersInfoModel.ICPNumber;
         Model.ContactName     = ticketWholesalersInfoModel.ContactName;
         Model.ContactTel      = ticketWholesalersInfoModel.ContactTel;
         Model.RefundAvgTime   = ticketWholesalersInfoModel.RefundAvgTime;
         Model.NoRefundAvgTime = ticketWholesalersInfoModel.NoRefundAvgTime;
         Model.HandleNum       = ticketWholesalersInfoModel.HandleNum;
         Model.SubmitNum       = ticketWholesalersInfoModel.SubmitNum;
         Model.ServicePrice    = ticketWholesalersInfoModel.ServicePrice;
         Model.WorkStartTime   = ticketWholesalersInfoModel.WorkStartTime;
         Model.WorkEndTime     = ticketWholesalersInfoModel.WorkEndTime;
         Model.DeliveryPrice   = ticketWholesalersInfoModel.DeliveryPrice;
         Model.IntoRatio       = ticketWholesalersInfoModel.IntoRatio;
     }
     if (companyModel != null)
     {
         Model.WebSite       = companyModel.WebSite;
         Model.CompanyRemark = companyModel.Remark;
         Model.AttachInfo    = companyModel.AttachInfo;
         Model.ContactMQ     = companyModel.ContactInfo.MQ;
     }
     if (Model != null)
     {
         return(Model);
     }
     else
     {
         return(null);
     }
 }
Пример #7
0
        /// <summary>
        /// 获取供应商扩展信息
        /// </summary>
        /// <param name="CompanyId">供应商编号</param>
        /// <returns>供应商扩展信息实体</returns>
        public virtual EyouSoft.Model.TicketStructure.TicketWholesalersInfo GetModel(string CompanyId)
        {
            EyouSoft.Model.TicketStructure.TicketWholesalersInfo model = null;
            DbCommand dc = this._database.GetSqlStringCommand(Sql_TicketWholesalersInfo_GETMODEL);

            this._database.AddInParameter(dc, "CompanyId", DbType.AnsiStringFixedLength, CompanyId);
            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._database))
            {
                if (dr.Read())
                {
                    model           = new EyouSoft.Model.TicketStructure.TicketWholesalersInfo();
                    model.CompanyId = dr[0].ToString();
                    model.ProxyLev  = dr.IsDBNull(1)?string.Empty:dr[1].ToString();

                    model.ICPNumber   = dr.IsDBNull(3) ? string.Empty : dr[3].ToString();
                    model.ContactName = dr.IsDBNull(4) ? string.Empty : dr[4].ToString();
                    model.ContactTel  = dr.IsDBNull(5) ? string.Empty : dr[5].ToString();
                    if (dr.GetInt32(6) > 0 && dr.GetInt32(14) > 0)
                    {
                        model.RefundAvgTime = ((dr.GetInt32(6) / 60) / dr.GetInt32(14));
                    }
                    if (dr.GetInt32(7) > 0 && dr.GetInt32(15) > 0)
                    {
                        model.NoRefundAvgTime = ((dr.GetInt32(7) / 60) / dr.GetInt32(15));
                    }
                    model.HandleNum     = dr.GetInt32(8);
                    model.SubmitNum     = dr.GetInt32(9);
                    model.ServicePrice  = dr.IsDBNull(10) ? 0 : dr.GetDecimal(10);
                    model.WorkStartTime = dr.IsDBNull(11) ? string.Empty: dr[11].ToString();
                    model.WorkEndTime   = dr.IsDBNull(12) ? string.Empty : dr[12].ToString();
                    model.DeliveryPrice = dr.IsDBNull(13) ? 0 : dr.GetDecimal(13);
                    model.IntoRatio     = dr.IsDBNull(16) ? 0 : decimal.Parse(dr[16].ToString());

                    model.OfficeNumber = dr.IsDBNull(17) ? "" : dr[17].ToString();
                }
            }
            return(model);
        }
Пример #8
0
 /// <summary>
 /// 修改供应商基本信息
 /// </summary>
 /// <param name="SupplierInfo">供应商实体</param>
 /// <returns></returns>
 public bool UpatetSupplierInfo(EyouSoft.Model.TicketStructure.TicketWholesalersInfo SupplierInfo)
 {
     return(idal.Update(SupplierInfo));
 }
Пример #9
0
        /// <summary>
        /// 注册新用户
        /// </summary>
        protected int RegisterCompany(string companyId)
        {
            int AddisTrue = 0;

            if (EyouSoft.Cache.Facade.EyouSoftCache.GetCache("REG_" + Request.UserHostAddress) != null)
            {
                AddisTrue = 5; //注册太频繁
                return(AddisTrue);
            }



            string CompanyName   = Utils.InputText(Request.Form["txtCompanyName"]);   //公司名
            string UserName      = Utils.InputText(Request.Form["txtUserName"]);      //用户名
            string PassWord      = Utils.InputText(Request.Form["txtFristPassWord"]); //密码
            string LicenseNumber = Utils.InputText(Request.Form["txtLicenseNumber"]); //许可证号
            string BrandName     = Utils.InputText(Request.Form["txtBrandName"]);     //品牌名称
            //int ProvinceId = 0;//省份
            //if (Request.Form["ctl00$Main$ProvinceAndCityList1$ddl_ProvinceList"] != null)
            //    ProvinceId = Convert.ToInt32(Request.Form["ctl00$Main$ProvinceAndCityList1$ddl_ProvinceList"]);
            //else if (Request.Form["ProvinceAndCityList1$ddl_ProvinceList"] != null)
            //    ProvinceId = Convert.ToInt32(Request.Form["ProvinceAndCityList1$ddl_ProvinceList"]);

            //int CityId = 0;//城市
            //if (Request.Form["ctl00$Main$ProvinceAndCityList1$ddl_CityList"] != null)
            //    CityId = Convert.ToInt32(Request.Form["ctl00$Main$ProvinceAndCityList1$ddl_CityList"]);
            //else if (Request.Form["ProvinceAndCityList1$ddl_CityList"] != null)
            //    CityId = Convert.ToInt32(Request.Form["ProvinceAndCityList1$ddl_CityList"]); //城市

            //int CountyId = 0;//地区(县)
            //if (Request.Form["ctl00$Main$ProvinceAndCityList1$ddl_CountyList"] != null)
            //    CountyId = Convert.ToInt32(Request.Form["ctl00$Main$ProvinceAndCityList1$ddl_CountyList"]);
            //else if (Request.Form["ProvinceAndCityList1$ddl_CityList"] != null)
            //    CountyId = Convert.ToInt32(Request.Form["ProvinceAndCityList1$ddl_CountyList"]); //城市
            int ProvinceId = 0;//省份

            if (Utils.GetFormValue(ddl_ProvinceList.UniqueID) != null)
            {
                ProvinceId = Convert.ToInt32(Utils.GetFormValue(ddl_ProvinceList.UniqueID));
            }

            int CityId = 0;//城市

            if (Utils.GetFormValue(ddl_CityList.UniqueID) != null)
            {
                CityId = Convert.ToInt32(Utils.GetFormValue(ddl_CityList.UniqueID));
            }
            int CountyId = 0;//地区(县)

            if (Utils.GetFormValue(ddl_CountyList.UniqueID) != null)
            {
                CountyId = Convert.ToInt32(Utils.GetFormValue(ddl_CountyList.UniqueID));
            }
            string OfficeAddress = Utils.InputText(Request.Form["txtOfficeAddress"]);       //办公地点
            //string CommendCompany = Utils.InputText(Request.Form["txtCommendCompany"]); 引荐单位
            string CompanyType       = Utils.InputText(Request.QueryString["companytype"]); //公司类型
            string ContactName       = Utils.InputText(Request.Form["txtContactName"]);
            string ContactTel        = Utils.InputText(Request.Form["txtContactTel"]);
            string ContactMobile     = Utils.InputText(Request.Form["txtContactMobile"]);
            string ContactFax        = Utils.InputText(Request.Form["txtContactFax"]);
            string ContactEmail      = Utils.InputText(Request.Form["txtContactEmail"]);
            string ContactQQ         = Utils.GetFormValue("qq", 100); //QQ,注意可能多个用半角逗号分割的
            string ContactMSN        = Utils.InputText(Request.Form["txtMsn"]);
            string CompanyInfo       = Utils.InputText(Request.Form["txtCompanyInfo"]);
            string CompanyMainpro    = Utils.InputText(Request.Form["txtMainProduct"]);
            string CompanySimpleName = Utils.InputText(Request.Form["txtCompanySimpleName"]);

            /*公司信息*/
            EyouSoft.Model.CompanyStructure.CompanyArchiveInfo model = new EyouSoft.Model.CompanyStructure.CompanyArchiveInfo();
            /*用户信息*/
            EyouSoft.Model.CompanyStructure.UserAccount UserModel = new EyouSoft.Model.CompanyStructure.UserAccount();
            /* 公司联系人信息 */
            EyouSoft.Model.CompanyStructure.ContactPersonInfo ContactModel = new EyouSoft.Model.CompanyStructure.ContactPersonInfo();
            string OtherSaleCity = "";

            if (string.IsNullOrEmpty(CompanyType))
            {
                AddisTrue = 0;
            }
            else
            {
                if (string.IsNullOrEmpty(companyId)) //随便逛逛申请,修改
                {
                    UserModel.UserName = UserName;   /*用户信息*/
                }
                UserModel.PassWordInfo.NoEncryptPassword = PassWord;
                ContactModel.ContactName = ContactName;
                ContactModel.Mobile      = ContactMobile;
                ContactModel.Email       = ContactEmail;
                ContactModel.QQ          = ContactQQ;
                ContactModel.Fax         = ContactFax;
                ContactModel.MSN         = ContactMSN;
                ContactModel.Tel         = ContactTel;
                if (CompanyType != "-1")  //游客
                {
                    #region 非随便看看用户
                    /*公司信息*/
                    model.CompanyName    = CompanyName;
                    model.ProvinceId     = ProvinceId;
                    model.CityId         = CityId;
                    model.CountyId       = CountyId;
                    model.CompanyAddress = OfficeAddress;
                    model.CompanyBrand   = BrandName;
                    model.License        = LicenseNumber;
                    model.Introduction   = CompanySimpleName;
                    model.Remark         = CompanyInfo;
                    model.Scale          = (EyouSoft.Model.CompanyStructure.CompanyScale)Utils.GetInt(this.sltCompanySize.Value);
                    model.ProvinceId     = Utils.GetInt(Utils.GetFormValue(this.ddl_ProvinceList.UniqueID));
                    model.CityId         = Utils.GetInt(Utils.GetFormValue(this.ddl_CityList.UniqueID));
                    model.CountyId       = Utils.GetInt(Utils.GetFormValue(this.ddl_CountyList.UniqueID));
                    model.CompanyBrand   = BrandName;
                    //model.Qualification
                    //model.AdminAccount = UserModel;

                    ContactModel.Tel = ContactTel;
                    ContactModel.Fax = ContactFax;
                    //model.ContactInfo = ContactModel;
                    // model.CommendPeople = CommendCompany;
                    //旅行社资质
                    string[] lxszz = Utils.Split(Utils.GetFormValue("chxzz"), ",");
                    if (lxszz != null && lxszz.Length > 0)
                    {
                        List <EyouSoft.Model.CompanyStructure.CompanyQualification> zizi = new List <EyouSoft.Model.CompanyStructure.CompanyQualification>();
                        for (int i = 0; i < lxszz.Length; i++)
                        {
                            if (lxszz[i] == "1")
                            {
                                zizi.Add(EyouSoft.Model.CompanyStructure.CompanyQualification.出境旅游);
                            }
                            if (lxszz[i] == "2")
                            {
                                zizi.Add(EyouSoft.Model.CompanyStructure.CompanyQualification.入境旅游);
                            }
                            if (lxszz[i] == "3")
                            {
                                zizi.Add(EyouSoft.Model.CompanyStructure.CompanyQualification.台湾旅游);
                            }
                        }
                        model.Qualification = zizi;
                    }
                    /* 公司身份 */
                    EyouSoft.Model.CompanyStructure.CompanyRole RoleMode = new EyouSoft.Model.CompanyStructure.CompanyRole();
                    EyouSoft.Model.CompanyStructure.CompanyType TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.全部;

                    if (CompanyType == "0") //线路供应商(专线,地接)
                    {
                        string[] strType = Utils.Split(Utils.GetFormValue("hdfZXandDj"), ",");
                        for (int i = 0; i < strType.Length; i++)
                        {
                            //设置经营线路区域
                            string[] strAreaList = Utils.Split(Utils.GetFormValue("checkbox_Area"), ",");
                            if (strAreaList != null)
                            {
                                List <EyouSoft.Model.SystemStructure.AreaBase> AreaList = new List <EyouSoft.Model.SystemStructure.AreaBase>();
                                for (int j = 0; j < strAreaList.Length; j++)
                                {
                                    EyouSoft.Model.SystemStructure.AreaBase item = new EyouSoft.Model.SystemStructure.AreaBase();
                                    item.AreaId = Convert.ToInt32(strAreaList[j]);
                                    AreaList.Add(item);
                                    item = null;
                                }
                                model.Area = AreaList;
                                AreaList   = null;
                            }
                            if (strType[i] == "1")
                            {
                                TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.专线;
                                string[] strSalelist = Request.Form.GetValues("ckSellCity");
                                if (strSalelist != null)
                                {
                                    //设置销售城市
                                    List <EyouSoft.Model.SystemStructure.CityBase> SaleCity = new List <EyouSoft.Model.SystemStructure.CityBase>();
                                    for (int j = 0; j < strSalelist.Length; j++)
                                    {
                                        EyouSoft.Model.SystemStructure.CityBase item = new EyouSoft.Model.SystemStructure.CityBase();
                                        item.CityId = Convert.ToInt32(strSalelist[j]);
                                        SaleCity.Add(item);
                                        item = null;
                                    }
                                    model.SaleCity = SaleCity;
                                    SaleCity       = null;
                                }
                                OtherSaleCity = Utils.InputText(Request.Form["inputOtherSaleCity"]);
                            }
                            if (strType[i] == "3")
                            {
                                TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.地接;
                            }
                            RoleMode.SetRole(TypeEmnu);
                            model.CompanyRole = RoleMode;
                        }
                    }
                    else
                    {
                        switch (CompanyType)
                        {
                        case "2":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.组团;
                            break;

                        case "4":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.景区;
                            break;

                        case "5":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.酒店;
                            break;

                        case "6":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.车队;
                            break;

                        case "7":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.旅游用品店;
                            break;

                        case "8":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.购物店;
                            break;

                        case "9":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.机票供应商;
                            //机票
                            ContactModel.QQ  = Utils.InputText(Request.Form["txtContactQQ"]);
                            ContactModel.MSN = Utils.InputText(Request.Form["txtContactMSN"]);
                            EyouSoft.Model.TicketStructure.TicketWholesalersInfo ticketinfo = new EyouSoft.Model.TicketStructure.TicketWholesalersInfo();
                            ticketinfo.ProxyLev      = Utils.InputText(Request.Form["txtDlNumber"]);
                            ticketinfo.WorkStartTime = Utils.InputText(Request.Form["WorkStartTime"]);     //上下班时间
                            ticketinfo.WorkEndTime   = Utils.InputText(Request.Form["WorkEndTime"]);
                            ticketinfo.OfficeNumber  = Utils.InputText(Request.Form["txtOffice"]);
                            if (!string.IsNullOrEmpty(companyId))     //随便逛逛申请,修改
                            {
                                ticketinfo.CompanyId = companyId;
                            }
                            model.TicketSupplierInfo = ticketinfo;
                            // model.License
                            break;

                        case "10":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.其他采购商;
                            break;

                        case "11":
                            TypeEmnu = EyouSoft.Model.CompanyStructure.CompanyType.随便逛逛;
                            break;
                        }
                        RoleMode.SetRole(TypeEmnu);
                        model.CompanyRole = RoleMode;
                    }
                    #endregion
                }
                model.AdminAccount = UserModel;
                model.ContactInfo  = ContactModel;
                if (!string.IsNullOrEmpty(companyId)) //随便逛逛申请,修改
                {
                    model.ID  = companyId;
                    AddisTrue = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().ToCompany(model, OtherSaleCity) == true ? 1 : 0;
                }
                else    //注册添加
                {
                    EyouSoft.Model.ResultStructure.UserResultInfo Result = EyouSoft.BLL.CompanyStructure.CompanyInfo.CreateInstance().Add(model, OtherSaleCity);
                    switch (Result)
                    {
                    case EyouSoft.Model.ResultStructure.UserResultInfo.Succeed:
                        AddisTrue = 1;
                        EyouSoft.Cache.Facade.EyouSoftCache.Add("REG_" + Request.UserHostAddress, DateTime.Now, DateTime.Now.AddMinutes(5));
                        break;

                    case EyouSoft.Model.ResultStructure.UserResultInfo.ExistsEmail:
                        AddisTrue = 2;
                        break;

                    case EyouSoft.Model.ResultStructure.UserResultInfo.ExistsUserName:
                        AddisTrue = 3;
                        break;

                    case EyouSoft.Model.ResultStructure.UserResultInfo.Error:
                        AddisTrue = 0;
                        break;
                    }
                }
            }
            return(AddisTrue);
        }
Пример #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string method = Utils.GetFormValue("method");

            this.Title = "支付-组团预定/散拼-机票";
            if (method != "InsertAccount")
            {
                this.Master.Naviagtion = AirTicketNavigation.团队预定散拼;
                orderBll = EyouSoft.BLL.TicketStructure.TicketOrder.CreateInstance();
                string orderId = Utils.GetQueryStringValue("orderId");
                orderInfo = orderBll.GetOrderInfoById(orderId);
                EyouSoft.Model.TicketStructure.TicketFlightCompany companyModel = EyouSoft.BLL.TicketStructure.TicketFlightCompany.CreateInstance().GetTicketFlightCompany(orderInfo.FlightId);
                if (companyModel != null)
                {
                    flightName = companyModel.AirportName;
                }


                companyName       = SiteUserInfo.CompanyName;
                contactName       = SiteUserInfo.ContactInfo.ContactName;
                address           = "";
                moible            = SiteUserInfo.ContactInfo.Mobile;
                buyInsCount       = orderInfo.Travellers.Where(i => i.IsBuyIns).Count();       //保险数
                buyItineraryCount = orderInfo.Travellers.Where(i => i.IsBuyItinerary).Count(); //行程单数
                supplierInfo      = EyouSoft.BLL.TicketStructure.TicketSupplierInfo.CreateInstance().GetSupplierInfo(orderInfo.SupplierCId);
                acl_rptCustomerList.DataSource = orderInfo.Travellers;
                acl_rptCustomerList.DataBind();
                list = EyouSoft.BLL.TicketStructure.TicketCompanyAccount.CreateInstance().GetTicketCompanyAccountList(orderInfo.SupplierCId);
            }
            else
            {
                string  payWhich    = Utils.GetFormValue("paywhich");
                string  freightType = Utils.GetFormValue("freightType");
                string  orderId     = Utils.GetFormValue("orderId");
                string  orderNo     = Utils.GetFormValue("orderNo");
                string  sellCId     = Utils.GetFormValue("sellcId");
                string  batchNo     = "";
                decimal total       = decimal.Parse(Utils.GetFormValue("total"));
                string  companyName = Utils.GetFormValue("companyname");
                string  contactName = Utils.GetFormValue("contactname");
                string  moible      = Utils.GetFormValue("moible");
                string  address     = Utils.GetFormValue("address");
                string  currUId     = SiteUserInfo.ID;
                string  currCId     = SiteUserInfo.CompanyID;
                string  theUrl      = GetPayUrl(payWhich, orderNo, total, freightType);
                decimal IntoRatio   = decimal.Parse(AlipayParameters.TongyeFee);                                                                         //平台交易费
                orderBll = EyouSoft.BLL.TicketStructure.TicketOrder.CreateInstance();
                orderBll.UpdateBuyerContact(orderId, companyName, contactName, moible, address);                                                         //修改订单联系方式
                EyouSoft.Model.TicketStructure.ItemType?         itemType = EyouSoft.Model.TicketStructure.ItemType.采购商付款到平台_订单;                         //流水金额记录项类型
                IList <EyouSoft.Model.TicketStructure.TicketPay> payList  = orderBll.GetPayList(orderId, itemType, orderNo, "");                         //获取交易记录
                list = EyouSoft.BLL.TicketStructure.TicketCompanyAccount.CreateInstance().GetTicketCompanyAccountList(sellCId);                          //获取供应商所有账户
                EyouSoft.Model.TicketStructure.TicketAccountType accountType = (EyouSoft.Model.TicketStructure.TicketAccountType)Utils.GetInt(payWhich); //获取支付类型
                string sellAccount = "";                                                                                                                 //供应商账户
                EyouSoft.Model.TicketStructure.TicketCompanyAccount accountModel = list.FirstOrDefault(i => i.InterfaceType == accountType);             //获取供应商账户实体
                if (accountModel != null)
                {
                    sellAccount = accountModel.AccountNumber; //赋值供应商账户
                }
                else
                {
                    Utils.ResponseMegError(); //如果对应接口账户不存在则输出失败
                    return;
                }
                if (payList == null || payList.Count == 0 || (payList != null && payList.Where(i => i.PayState == EyouSoft.Model.TicketStructure.PayState.交易完成).Count() < 1))//如果交易记录不存在或交易状态不是完成则添加支付前交易记录
                {
                    if (orderBll.PayBefore(orderId, orderNo, sellAccount, IntoRatio, SiteUserInfo.ID, SiteUserInfo.CompanyID, total, accountType, sellCId, "", out batchNo))
                    {
                        Utils.ResponseMeg(true, theUrl);
                    }
                    else
                    {
                        Utils.ResponseMegError();
                    }
                }

                else if (payList != null && payList.Where(i => i.PayState == EyouSoft.Model.TicketStructure.PayState.交易完成).Count() > 0)
                {
                    Utils.ResponseMeg(false, "你已经支付过,并且交易完成了!");
                }
                else
                {
                    Utils.ResponseMeg(true, theUrl);
                }
            }
        }