Example #1
0
        /// <summary>
        /// 获取公司信息实体
        /// </summary>
        /// <param name="CompanyId">公司编号</param>
        /// <param name="SystemId">系统编号</param>
        /// <returns></returns>
        public EyouSoft.Model.CompanyStructure.CompanyInfo GetModel(int CompanyId, int SystemId)
        {
            IList <EyouSoft.Model.CompanyStructure.CompanyAccount> CompanyAccountList = null;

            EyouSoft.Model.CompanyStructure.CompanyInfo model = null;
            string    StrSql = string.Format("SELECT * FROM tbl_CompanyInfo where id={0} AND SystemId={1}  SELECT * FROM tbl_CompanyAccount WHERE CompanyId={0}", CompanyId, SystemId);
            DbCommand dc     = this._db.GetSqlStringCommand(StrSql);

            using (IDataReader dr = DbHelper.ExecuteReader(dc, this._db))
            {
                if (dr.Read())
                {
                    model = new EyouSoft.Model.CompanyStructure.CompanyInfo()
                    {
                        CompanyAddress     = dr.IsDBNull(dr.GetOrdinal("CompanyAddress")) ? "" : dr.GetString(dr.GetOrdinal("CompanyAddress")),
                        CompanyEnglishName = dr.IsDBNull(dr.GetOrdinal("CompanyEnglishName")) ? "" : dr.GetString(dr.GetOrdinal("CompanyEnglishName")),
                        CompanyName        = dr.IsDBNull(dr.GetOrdinal("CompanyName")) ? "" : dr.GetString(dr.GetOrdinal("CompanyName")),
                        CompanySiteUrl     = dr.IsDBNull(dr.GetOrdinal("CompanySiteUrl")) ? "" : dr.GetString(dr.GetOrdinal("CompanySiteUrl")),
                        CompanyType        = dr.IsDBNull(dr.GetOrdinal("CompanyType")) ? "" : dr.GetString(dr.GetOrdinal("CompanyType")),
                        CompanyZip         = dr.IsDBNull(dr.GetOrdinal("CompanyZip")) ? "" : dr.GetString(dr.GetOrdinal("CompanyZip")),
                        ContactFax         = dr.IsDBNull(dr.GetOrdinal("ContactFax")) ? "" : dr.GetString(dr.GetOrdinal("ContactFax")),
                        ContactMobile      = dr.IsDBNull(dr.GetOrdinal("ContactMobile")) ? "" : dr.GetString(dr.GetOrdinal("ContactMobile")),
                        ContactName        = dr.IsDBNull(dr.GetOrdinal("ContactName")) ? "" : dr.GetString(dr.GetOrdinal("ContactName")),
                        ContactTel         = dr.IsDBNull(dr.GetOrdinal("ContactTel")) ? "" : dr.GetString(dr.GetOrdinal("ContactTel")),
                        License            = dr.IsDBNull(dr.GetOrdinal("License")) ? "" : dr.GetString(dr.GetOrdinal("License")),
                        SystemId           = dr.GetInt32(dr.GetOrdinal("SystemId")),
                        Id        = dr.GetInt32(dr.GetOrdinal("Id")),
                        IssueTime = dr.GetDateTime(dr.GetOrdinal("IssueTime"))
                    };
                    if (dr.NextResult())
                    {
                        CompanyAccountList = new List <EyouSoft.Model.CompanyStructure.CompanyAccount>();
                        while (dr.Read())
                        {
                            EyouSoft.Model.CompanyStructure.CompanyAccount Account = new EyouSoft.Model.CompanyStructure.CompanyAccount()
                            {
                                AccountName = dr.IsDBNull(dr.GetOrdinal("AccountName")) ? "" : dr.GetString(dr.GetOrdinal("AccountName")),
                                BankName    = dr.IsDBNull(dr.GetOrdinal("BankName")) ? "" : dr.GetString(dr.GetOrdinal("BankName")),
                                BankNo      = dr.IsDBNull(dr.GetOrdinal("BankNo")) ? "" : dr.GetString(dr.GetOrdinal("BankNo")),
                                CompanyId   = dr.GetInt32(dr.GetOrdinal("CompanyId")),
                            };
                            CompanyAccountList.Add(Account);
                            Account = null;
                        }
                        model.CompanyAccountList = CompanyAccountList;
                    }
                }
            }
            return(model);
        }
Example #2
0
        /// <summary>
        /// 公司账户修改
        /// </summary>
        /// <param name="model">公司账户信息实体</param>
        /// <returns></returns>
        public bool AccountUpdate(EyouSoft.Model.CompanyStructure.CompanyAccount model)
        {
            bool IsTrue = false;

            EyouSoft.Data.CompanyAccount DataModel = dcDal.CompanyAccount.FirstOrDefault(item =>
                                                                                         item.Id == model.Id && item.CompanyId == model.CompanyId
                                                                                         );
            if (DataModel != null)
            {
                DataModel.AccountName = model.AccountName;
                DataModel.BankName    = model.BankName;
                DataModel.BankNo      = model.BankNo;
                dcDal.SubmitChanges();
                IsTrue = true;
            }
            DataModel = null;
            return(IsTrue);
        }
Example #3
0
        /// <summary>
        /// 公司账户新增
        /// </summary>
        /// <param name="model">公司账户信息实体</param>
        /// <returns></returns>
        public bool AccountAdd(EyouSoft.Model.CompanyStructure.CompanyAccount model)
        {
            bool IsTrue = false;

            EyouSoft.Data.CompanyAccount AcountModel = new EyouSoft.Data.CompanyAccount()
            {
                AccountName = model.AccountName,
                BankName    = model.BankName,
                BankNo      = model.BankNo,
                CompanyId   = model.CompanyId,
            };
            dcDal.CompanyAccount.InsertOnSubmit(AcountModel);
            dcDal.SubmitChanges();
            if (dcDal.ChangeConflicts.Count == 0)
            {
                IsTrue = true;
            }
            AcountModel = null;
            return(IsTrue);
        }
Example #4
0
        /// <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;
                }
            }
        }
Example #5
0
        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.CompanyInfo   companyBll = new EyouSoft.BLL.CompanyStructure.CompanyInfo();
            EyouSoft.Model.CompanyStructure.CompanyInfo infoModel  = null;//公司信息实体
            string method = Utils.GetFormValue("hidMethod");

            if (method == "save")
            {
                #region 保存公司信息
                if (Utils.InputText(txtCompanyName.Value) == "")
                {
                    MessageBox.Show(this, "公司名称不为空");
                    return;
                }
                //保存
                EyouSoft.Model.CompanyStructure.CompanyAccount account = new EyouSoft.Model.CompanyStructure.CompanyAccount(); //公司账户
                infoModel = new EyouSoft.Model.CompanyStructure.CompanyInfo();                                                 //公司信息实体
                infoModel.CompanyAddress     = Utils.InputText(txtAddress.Value);                                              //地址
                infoModel.ContactName        = Utils.InputText(txtAdmin.Value);                                                //负责人
                account.BankName             = Utils.InputText(txtBank.Value);                                                 //开户行
                account.CompanyId            = CurrentUserCompanyID;                                                           //公司编号
                infoModel.CompanyZip         = Utils.InputText(txtEmail.Value);                                                //邮箱
                account.AccountName          = Utils.InputText(txtUserName.Value);                                             //户名
                account.BankNo               = Utils.InputText(txtUserNo.Value);                                               //账号
                infoModel.CompanyEnglishName = Utils.InputText(txtEngName.Value);                                              //公司英文名
                infoModel.ContactFax         = Utils.InputText(txtFax.Value);                                                  //公司传真
                infoModel.License            = Utils.InputText(txtLicence.Value);                                              //公司许可证
                infoModel.ContactMobile      = Utils.InputText(txtMoible.Value);                                               //公司手机
                infoModel.CompanyName        = Utils.InputText(txtCompanyName.Value);                                          //公司名
                infoModel.ContactTel         = Utils.InputText(txtTel.Value);                                                  //电话
                infoModel.CompanyType        = Utils.InputText(txtType.Value);                                                 //旅行社类别
                infoModel.CompanySiteUrl     = Utils.InputText(txtWeb.Value);                                                  //网站
                infoModel.CompanyAccountList = new List <EyouSoft.Model.CompanyStructure.CompanyAccount>();
                infoModel.CompanyAccountList.Add(account);                                                                     //添加到账户集合
                infoModel.SystemId = CurrentUserCompanyID;                                                                     //系统号
                infoModel.Id       = CurrentUserCompanyID;                                                                     //公司号
                bool result = false;
                result = companyBll.Update(infoModel);
                MessageBox.ShowAndRedirect(this, result?"保存成功!":"保存失败!", "/systemset/CompanyInfo.aspx");
                #endregion
            }
            else
            {
                #region 初始化公司信息
                //初始化
                infoModel = companyBll.GetModel(CurrentUserCompanyID, CurrentUserCompanyID);
                if (infoModel != null)
                {
                    EyouSoft.Model.CompanyStructure.CompanyAccount account = null;//公司账户
                    if (infoModel.CompanyAccountList != null && infoModel.CompanyAccountList.Count > 0)
                    {
                        account = infoModel.CompanyAccountList[0];
                    }
                    txtAddress.Value     = infoModel.CompanyAddress;     //地址
                    txtAdmin.Value       = infoModel.ContactName;        //负责人
                    txtEmail.Value       = infoModel.CompanyZip;         //邮箱
                    txtEngName.Value     = infoModel.CompanyEnglishName; //公司英文名
                    txtFax.Value         = infoModel.ContactFax;         //公司传真
                    txtLicence.Value     = infoModel.License;            //公司许可证
                    txtMoible.Value      = infoModel.ContactMobile;      //公司手机
                    txtCompanyName.Value = infoModel.CompanyName;        //公司名
                    txtTel.Value         = infoModel.ContactTel;         //电话
                    txtType.Value        = infoModel.CompanyType;        //旅行社类别
                    if (account != null)
                    {
                        txtBank.Value     = account.BankName;    //开户行
                        txtUserName.Value = account.AccountName; //户名
                        txtUserNo.Value   = account.BankNo;      //账号
                    }
                    txtWeb.Value = infoModel.CompanySiteUrl;     //网站
                }
                #endregion
            }
        }