Example #1
0
 /// <summary>
 /// 绑定要修改数据
 /// </summary>
 /// <param name="tid"></param>
 private void bind()
 {
     tid = Utils.GetInt(Utils.GetQueryStringValue("tid"));
     if (tid > 0)
     {
         csModel = csBll.GetModel(tid, this.CurrentUserCompanyID);
     }
 }
Example #2
0
        /// <summary>
        /// 修改供应商信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool UpdateSupplierInfo(EyouSoft.Model.CompanyStructure.CompanySupplier model)
        {
            bool result = false;

            result = Dal.UpdateSupplerInfo(model);
            handleLogsBll.Add(AddLogs("修改", result));

            return(result);
        }
Example #3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string type = context.Request.QueryString["type"];
            string id   = context.Request.QueryString["id"];

            //登录公司ID
            EyouSoft.SSOComponent.Entity.UserInfo userModel = EyouSoft.Security.Membership.UserProvider.GetUser();
            //如果公司ID为0表示没有公司登录 并返回false
            if (userModel == null)
            {
                context.Response.Write("{Islogin:false}");
                return;
            }
            if (type != null)
            {
                EyouSoft.BLL.PlanStruture.TravelAgency travelbll = new EyouSoft.BLL.PlanStruture.TravelAgency();
                if (type == "Delete")
                {
                    if (id != null && id != "")
                    {
                        bool b = travelbll.DelTravelAgency(id);
                        if (b)
                        {
                            context.Response.Write("OK");
                        }
                        else
                        {
                            context.Response.Write("Error");
                        }
                    }
                }
                if (type == "GetInfo")
                {
                    //声明操作对象
                    EyouSoft.BLL.CompanyStructure.CompanySupplier   bll          = new EyouSoft.BLL.CompanyStructure.CompanySupplier();
                    EyouSoft.Model.CompanyStructure.CompanySupplier companyModel = bll.GetModel(Utils.GetInt(id), userModel.CompanyID);
                    string returnStr = "{0}||{1}||{2}||{3}";
                    if (companyModel != null)
                    {
                        if (companyModel.SupplierContact != null && companyModel.SupplierContact.Count > 0)
                        {
                            returnStr = string.Format(returnStr, companyModel.SupplierContact[0].ContactName, companyModel.SupplierContact[0].ContactTel, companyModel.Commission.ToString("0.00"), companyModel.LicenseKey);
                        }
                        else
                        {
                            returnStr = string.Format(returnStr, "", "", companyModel.Commission.ToString("0.00"), companyModel.LicenseKey);
                        }
                    }
                    context.Response.Write(returnStr);
                }
            }
        }
Example #4
0
        /// <summary>
        /// 删除地接
        /// </summary>
        /// <param name="TravelId">安排地接编号</param>
        /// <returns></returns>
        public bool DelTravelAgency(string TravelId)
        {
            EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo modelTravel = GetTravelModel(TravelId);
            if (dal.DeletTravelModel(TravelId))
            {
                //加日志
                //AddSysLog("删除");
                //维护地接社交易数量
                if (modelTravel != null)
                {
                    EyouSoft.BLL.CompanyStructure.CompanySupplier   bllSuplier = new EyouSoft.BLL.CompanyStructure.CompanySupplier();// EyouSoft.BLL.CompanyStructure.CompanySupplier();
                    EyouSoft.Model.CompanyStructure.CompanySupplier Model      = bllSuplier.GetModel(modelTravel.TravelAgencyID, modelTravel.CompanyId);

                    if (Model != null && Model.Id > 0)
                    {
                        EyouSoft.BLL.UtilityStructure.Utility idal = new EyouSoft.BLL.UtilityStructure.Utility();
                        idal.ServerTradeCount(new int[] { Model.Id });
                    }

                    //重新计算团队支出
                    EyouSoft.BLL.UtilityStructure.Utility u = new EyouSoft.BLL.UtilityStructure.Utility();
                    //价格维护
                    u.CalculationTourOut(modelTravel.TourId, null);

                    #region LGWR
                    EyouSoft.Model.EnumType.TourStructure.TourType?    tourType = new EyouSoft.BLL.TourStructure.Tour().GetTourType(modelTravel.TourId);
                    Model.EnumType.CompanyStructure.SysPermissionClass mokuai   = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.散拼计划_散拼计划;
                    if (tourType != null && tourType == EyouSoft.Model.EnumType.TourStructure.TourType.团队计划)
                    {
                        mokuai = EyouSoft.Model.EnumType.CompanyStructure.SysPermissionClass.团队计划_团队计划;
                    }

                    EyouSoft.Model.CompanyStructure.SysHandleLogs logInfo = new EyouSoft.Model.CompanyStructure.SysHandleLogs();
                    logInfo.CompanyId    = 0;
                    logInfo.DepatId      = 0;
                    logInfo.EventCode    = EyouSoft.Model.CompanyStructure.SysHandleLogsNO.EventCode;
                    logInfo.EventIp      = string.Empty;
                    logInfo.EventMessage = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "{0}在" + mokuai.ToString() + "删除了地接安排,安排编号:" + modelTravel.ID + ",计划编号为:" + modelTravel.TourId;
                    logInfo.EventTime    = DateTime.Now;
                    logInfo.EventTitle   = "删除地接安排";
                    logInfo.ModuleId     = mokuai;
                    logInfo.OperatorId   = 0;
                    this.Logwr(logInfo);
                    #endregion

                    return(true);
                }
            }

            return(false);
        }
Example #5
0
        protected void rpt_area_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo item         = e.Item.DataItem as EyouSoft.Model.PlanStructure.LocalTravelAgencyInfo;
            EyouSoft.BLL.CompanyStructure.CompanySupplier      bll          = new EyouSoft.BLL.CompanyStructure.CompanySupplier();
            EyouSoft.Model.CompanyStructure.CompanySupplier    companyModel = bll.GetModel(item.TravelAgencyID, CurrentUserCompanyID);
            Literal lt_cName = e.Item.FindControl("lt_cName") as Literal;
            Literal lt_cTel  = e.Item.FindControl("lt_cTel") as Literal;
            Literal lt_cFax  = e.Item.FindControl("lt_cFax") as Literal;

            if (companyModel != null && companyModel.SupplierContact.Count > 0)
            {
                lt_cName.Text = companyModel.SupplierContact[0].ContactName;
                lt_cTel.Text  = companyModel.SupplierContact[0].ContactTel;
                lt_cFax.Text  = companyModel.SupplierContact[0].ContactFax;
            }
        }
Example #6
0
        /// <summary>
        /// 地接的增加和修改
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
            csBll   = new EyouSoft.BLL.CompanyStructure.CompanySupplier();
            csModel = new EyouSoft.Model.CompanyStructure.CompanySupplier();
            this.ucProvince1.CompanyId = CurrentUserCompanyID;
            this.ucProvince1.IsFav     = true;
            this.ucCity1.CompanyId     = CurrentUserCompanyID;
            this.ucCity1.IsFav         = true;
            if (IsPostBack)
            {
                Save();
            }
            else
            {
                type = Utils.GetQueryStringValue("type");
                switch (type)
                {
                case "modify":
                    if (CheckGrant(global::Common.Enum.TravelPermission.供应商管理_地接_修改))
                    {
                        bind();
                    }
                    else
                    {
                        Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_地接_修改, false);
                    }
                    break;

                case "show":

                    show = true;
                    bind();

                    break;

                default:
                    if (!CheckGrant(global::Common.Enum.TravelPermission.供应商管理_地接_新增))
                    {
                        Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.供应商管理_地接_新增, false);
                    }
                    break;
                }
                bindProandCity();
            }
        }
Example #7
0
        private void loadXls()
        {
            string data = Utils.GetFormValue("dataxls");

            string[] s = data.Split(';');
            EyouSoft.BLL.CompanyStructure.CompanySupplier csBll = new EyouSoft.BLL.CompanyStructure.CompanySupplier();

            List <EyouSoft.Model.CompanyStructure.CompanySupplier> list = new List <EyouSoft.Model.CompanyStructure.CompanySupplier>();

            for (int i = 0; i < s.Length; i++)
            {
                string[] smodel = s[i].Split(',');
                if (smodel.Length == 6 && !string.IsNullOrEmpty(smodel[0]) && !string.IsNullOrEmpty(smodel[1]) && !string.IsNullOrEmpty(smodel[2]))
                {
                    EyouSoft.Model.CompanyStructure.CompanySupplier csModel = new EyouSoft.Model.CompanyStructure.CompanySupplier();
                    csModel.ProvinceName  = HttpUtility.UrlDecode(smodel[0]);
                    csModel.CityName      = HttpUtility.UrlDecode(smodel[1]);
                    csModel.UnitName      = HttpUtility.UrlDecode(smodel[2]);
                    csModel.UnitAddress   = HttpUtility.UrlDecode(smodel[3]);
                    csModel.Commission    = Utils.GetDecimal(HttpUtility.UrlDecode(smodel[4]));
                    csModel.Remark        = HttpUtility.UrlDecode(smodel[5]);
                    csModel.OperatorId    = SiteUserInfo.ID;
                    csModel.IssueTime     = DateTime.Now;
                    csModel.CompanyId     = CurrentUserCompanyID;
                    csModel.AgreementFile = string.Empty;
                    csModel.IsDelete      = false;
                    csModel.SupplierType  = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.地接;
                    csModel.TradeNum      = 0;
                    csModel.UnitPolicy    = string.Empty;
                    list.Add(csModel);
                }
            }
            bool res = false;

            res = csBll.ImportExcelData(list);

            Response.Clear();
            Response.Write(string.Format("{{\"res\":{0}}}", res ? 1 : -1));
            Response.End();
        }
Example #8
0
        /// <summary>
        /// 实体转换
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        private EyouSoft.Model.SupplierStructure.SupplierOther ConvertOtherModel(EyouSoft.Model.CompanyStructure.CompanySupplier model)
        {
            EyouSoft.Model.SupplierStructure.SupplierOther targetModel = new EyouSoft.Model.SupplierStructure.SupplierOther();
            targetModel.Id              = model.Id;
            targetModel.IsDelete        = model.IsDelete;
            targetModel.IssueTime       = model.IssueTime;
            targetModel.OperatorId      = model.OperatorId;
            targetModel.ProvinceId      = model.ProvinceId;
            targetModel.ProvinceName    = model.ProvinceName;
            targetModel.Remark          = model.Remark;
            targetModel.SupplierContact = model.SupplierContact;
            targetModel.SupplierPic     = model.SupplierPic;
            targetModel.SupplierType    = model.SupplierType;
            targetModel.TradeNum        = model.TradeNum;
            targetModel.UnitAddress     = model.UnitAddress;
            targetModel.UnitName        = model.UnitName;
            targetModel.CompanyId       = model.CompanyId;
            targetModel.CityName        = model.CityName;
            targetModel.CityId          = model.CityId;
            targetModel.AgreementFile   = model.AgreementFile;

            return(targetModel);
        }
Example #9
0
        /// <summary>
        /// 页面初始化方法
        /// </summary>
        /// <param name="tourId">行程单ID</param>
        protected void DataInit(string tourId)
        {
            //声明bll对象
            EyouSoft.BLL.TourStructure.Tour bll = new EyouSoft.BLL.TourStructure.Tour(SiteUserInfo);
            //声明团队计划对象
            EyouSoft.Model.TourStructure.TourTeamInfo model = (EyouSoft.Model.TourStructure.TourTeamInfo)bll.GetTourInfo(tourId);
            if (model != null)
            {
                #region 页面控件赋值
                //出团日期
                LeaveDate = model.LDate.ToString("yyyy-MM-dd");
                //出发交通
                lblBegin = model.LTraffic;
                //组团社
                this.txtZutuanName.Text = model.BuyerCName;
                //联系信息
                EyouSoft.BLL.CompanyStructure.CompanySupplier   supplierBll  = new EyouSoft.BLL.CompanyStructure.CompanySupplier();
                EyouSoft.Model.CompanyStructure.CompanySupplier companyModel = supplierBll.GetModel(model.BuyerCId, SiteUserInfo.CompanyID);
                if (companyModel != null)
                {
                    if (companyModel.SupplierContact != null && companyModel.SupplierContact.Count > 0)
                    {
                        this.txtIncomeMan.Text = companyModel.SupplierContact[0].ContactName;
                        this.txtFax.Text       = companyModel.SupplierContact[0].ContactFax;
                    }
                }
                //集合时间
                lblGatheredDate.Text = model.GatheringTime;
                //送团人
                if (model.SentPeoples != null && model.SentPeoples.Count > 0)
                {
                    this.txtOffName.Text = model.SentPeoples[0].OperatorName;
                }
                this.txtAddress.Text = model.GatheringPlace;


                //返程交通
                lblEnd = model.RTraffic;
                if (model.TourNormalInfo != null)
                {
                    //不含项目
                    this.lblNoProject.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.BuHanXiangMu);
                    //购物安排
                    this.lblBuy.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.GouWuAnPai);
                    //注意事项
                    this.lblNote.Text = EyouSoft.Common.Function.StringValidate.TextToHtml(model.TourNormalInfo.ZhuYiShiXiang);
                    //行程安排

                    if (model.TourNormalInfo.Plans != null)
                    {
                        this.listCount            = model.TourNormalInfo.Plans.Count;
                        tdCount                   = model.TourNormalInfo.Plans.Count;
                        this.rptTravel.DataSource = model.TourNormalInfo.Plans;

                        this.rptTravel.DataBind();
                    }
                }
                //人数
                #region 人数And结算价
                if (model.TourType == EyouSoft.Model.EnumType.TourStructure.TourType.团队计划)
                {
                    TourQuotePrint priantTQP = new TourQuotePrint();
                    string         number    = string.Empty;
                    string         money     = string.Empty;
                    priantTQP.getPepoleNum(SiteUserInfo.CompanyID, model.PlanPeopleNumber, model.TourTeamUnit, ref number, ref money);
                    this.lblAdult.Text = number;
                }
                else
                {
                    this.lblAdult.Text = model.PlanPeopleNumber.ToString();
                }
                #endregion
                //团队类型
                this.txtTourType.Text = model.TourType.ToString();


                //包含项目
                this.rptProject.DataSource = model.Services;
                this.rptProject.DataBind();

                #endregion
            }
        }
Example #10
0
        /// <summary>
        /// 保存或修改信息
        /// </summary>
        private void Save()
        {
            tid = Utils.GetInt(Utils.GetFormValue("tid"));
            if (tid > 0)
            {
                csModel = csBll.GetModel(tid, this.CurrentUserCompanyID);
            }
            else
            {
                csModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.地接;
            }
            //省份编号
            csModel.ProvinceId = this.ucProvince1.ProvinceId;
            //身份名称
            csModel.ProvinceName = Utils.GetFormValue("proname");
            //城市名称
            csModel.CityName = Utils.GetFormValue("cityname");
            //城市编号
            csModel.CityId = this.ucCity1.CityId;
            //单位名称
            csModel.UnitName = Utils.GetFormValue("unionname");
            if (csModel.UnitName.Length == 1)
            {
                csModel.UnitName += " ";
            }
            //地址
            csModel.UnitAddress = Utils.GetFormValue("txtAddress");
            //合作协议
            if (Request.Files.Count > 0)
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename);
                if (result)
                {
                    csModel.AgreementFile = filepath;
                }
            }
            //许可证号
            csModel.LicenseKey = Utils.GetFormValue("txtLicense");
            //返佣
            csModel.Commission = Utils.GetDecimal(Utils.GetFormValue("txtReturnSet"));
            //备注
            csModel.Remark = Utils.GetFormValue("remark");
            //公司编号
            csModel.CompanyId = this.SiteUserInfo.CompanyID;
            //操作人
            csModel.OperatorId = this.SiteUserInfo.ID;
            //供应商联系人
            csModel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>();

            string[] accmanId       = Utils.GetFormValues("hidcontactid");//联系人ID
            string[] accmanname     = Utils.GetFormValues("inname");
            string[] accmandate     = Utils.GetFormValues("indate");
            string[] accmanphone    = Utils.GetFormValues("inphone");
            string[] accmanmobile   = Utils.GetFormValues("inmobile");
            string[] accmanfax      = Utils.GetFormValues("infax");
            string[] accmanqq       = Utils.GetFormValues("inqq");
            string[] accmanUserName = Utils.GetFormValues("inusername");   //用户名
            string[] accmanPwd      = Utils.GetFormValues("inpwd");        //密码
            string[] accmanUserId   = Utils.GetFormValues("inusernameid"); //用户ID

            for (int i = 0; i < accmanname.Length; i++)
            {
                EyouSoft.Model.CompanyStructure.SupplierContact scModel = new EyouSoft.Model.CompanyStructure.SupplierContact();
                scModel.ContactName   = accmanname[i];
                scModel.JobTitle      = accmandate[i];
                scModel.ContactTel    = accmanphone[i];
                scModel.ContactMobile = accmanmobile[i];
                scModel.QQ            = accmanqq[i];
                scModel.ContactFax    = accmanfax[i];
                scModel.SupplierType  = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.地接;

                scModel.Id = Utils.GetInt(accmanId[i]);       //联系人ID
                //判断对应联系人的用户名是否为空
                if (!string.IsNullOrEmpty(accmanUserName[i])) //不为空
                {
                    scModel.UserAccount = new EyouSoft.Model.CompanyStructure.UserAccount()
                    {
                        ID           = Utils.GetInt(accmanUserId[i]),
                        UserName     = accmanUserName[i],
                        PassWordInfo = new EyouSoft.Model.CompanyStructure.PassWord()
                        {
                            NoEncryptPassword = accmanPwd[i]
                        },
                        TourCompanyId = tid
                    };
                }
                else//为空
                {
                    //将当前联系人的用户信息初始化为空
                    scModel.UserAccount = null;
                }

                csModel.SupplierContact.Add(scModel);
            }

            //判断用户信息中 是否存在用户名已被使用
            bool isUserNameExist = false;

            System.Text.StringBuilder strbUserName            = new System.Text.StringBuilder();
            EyouSoft.BLL.CompanyStructure.CompanyUser userBll = new EyouSoft.BLL.CompanyStructure.CompanyUser(SiteUserInfo);

            foreach (EyouSoft.Model.CompanyStructure.SupplierContact scModel in csModel.SupplierContact)
            {
                //判断当前用户信息 ,是否是 新增的用户信息
                if (scModel.UserAccount != null && scModel.UserAccount.ID == 0)//是
                {
                    //判断用户名 是否已经存在
                    if (userBll.IsExists(0, scModel.UserAccount.UserName, CurrentUserCompanyID) == true)//是
                    {
                        //修改状态
                        isUserNameExist = true;
                        //添加重复的用户名到strbUsername
                        strbUserName.Append(scModel.UserAccount.UserName).Append(",");
                    }
                }
            }

            //去除strbUserName中最后一个多余的【,】逗号
            if (strbUserName.Length > 0)
            {
                strbUserName.Remove(strbUserName.Length - 1, 1);
            }

            bool res = false;

            if (tid > 0)
            {
                res = csBll.UpdateSupplierInfo(csModel);
            }
            else
            {
                res = csBll.AddSupplierInfo(csModel);
            }

            string msg = "";             //提示信息

            if (isUserNameExist == true) //如果存在用户名重复
            {
                msg = "地接信息保存成功,新增的用户名中,(" + strbUserName.ToString() + ")已被使用,请更换其他用户名";
            }
            else
            {
                msg = "地接信息保存成功";
            }

            if (res)
            {
                MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();{2}", msg, Utils.GetQueryStringValue("iframeId"), tid > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/SupplierControl/AreaConnect/AreaConnect.aspx';"));
            }
            else
            {
                MessageBox.ResponseScript(this, ";alert('保存失败!');");
            }
        }
Example #11
0
        /// <summary>
        /// 保存或修改信息
        /// </summary>
        private void Save()
        {
            tid = Utils.GetInt(Utils.GetFormValue("tid"));
            if (tid > 0)
            {
                csModel = csBll.GetModel(tid, this.CurrentUserCompanyID);
            }
            else
            {
                csModel.SupplierType = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.票务;
            }
            csModel.ProvinceId   = this.ucProvince1.ProvinceId;
            csModel.ProvinceName = Utils.GetFormValue("proname");
            csModel.CityName     = Utils.GetFormValue("cityname");
            csModel.CityId       = this.ucCity1.CityId;
            csModel.UnitName     = Utils.GetFormValue("unionname");
            csModel.UnitAddress  = Utils.GetFormValue("txtAddress");
            if (Request.Files.Count > 0)
            {
                string filepath    = string.Empty;
                string oldfilename = string.Empty;
                bool   result      = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename);
                if (result)
                {
                    csModel.AgreementFile = filepath;
                }
            }
            csModel.UnitPolicy      = Utils.GetFormValue("police");
            csModel.Remark          = Utils.GetFormValue("remark");
            csModel.CompanyId       = this.SiteUserInfo.CompanyID;
            csModel.OperatorId      = this.SiteUserInfo.ID;
            csModel.SupplierContact = new List <EyouSoft.Model.CompanyStructure.SupplierContact>();
            string[] accmanname   = Utils.GetFormValues("inname");
            string[] accmandate   = Utils.GetFormValues("indate");
            string[] accmanphone  = Utils.GetFormValues("inphone");
            string[] accmanmobile = Utils.GetFormValues("inmobile");
            string[] accmanfax    = Utils.GetFormValues("infax");
            string[] accmanqq     = Utils.GetFormValues("inqq");
            string[] accmanemail  = Utils.GetFormValues("inemail");
            for (int i = 0; i < accmanname.Length; i++)
            {
                EyouSoft.Model.CompanyStructure.SupplierContact scModel = new EyouSoft.Model.CompanyStructure.SupplierContact();
                scModel.ContactName   = accmanname[i];
                scModel.JobTitle      = accmandate[i];
                scModel.ContactTel    = accmanphone[i];
                scModel.ContactMobile = accmanmobile[i];
                scModel.QQ            = accmanqq[i];
                scModel.Email         = accmanemail[i];
                scModel.ContactFax    = accmanfax[i];
                scModel.SupplierType  = EyouSoft.Model.EnumType.CompanyStructure.SupplierType.票务;
                csModel.SupplierContact.Add(scModel);
            }
            bool res = false;

            if (tid > 0)
            {
                res = csBll.UpdateSupplierInfo(csModel);
            }
            else
            {
                res = csBll.AddSupplierInfo(csModel);
            }

            if (res)
            {
                MessageBox.ResponseScript(this, string.Format(";alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide(); {2}", "保存成功!", Utils.GetQueryStringValue("iframeId"), tid > 0 ? "window.parent.location.reload();" : "window.parent.location.href='/SupplierControl/TicketService/TicketService.aspx';"));
            }
            else
            {
                MessageBox.ResponseScript(this, ";alert('保存失败!');");
            }
        }