コード例 #1
0
        /// <summary>
        /// 获取性别
        /// </summary>
        /// <param name="gender"></param>
        /// <returns></returns>
        private EyouSoft.Model.CompanyStructure.Sex GetGender(EyouSoft.OpenRelation.Model.Gender gender)
        {
            EyouSoft.Model.CompanyStructure.Sex g = EyouSoft.Model.CompanyStructure.Sex.未知;
            switch (gender)
            {
            case EyouSoft.OpenRelation.Model.Gender.G: g = EyouSoft.Model.CompanyStructure.Sex.男; break;

            case EyouSoft.OpenRelation.Model.Gender.L: g = EyouSoft.Model.CompanyStructure.Sex.女; break;
            }
            return(g);
        }
コード例 #2
0
        protected string CompanyId = string.Empty; //公司id
        #endregion

        #region 页面加载
        protected void Page_Load(object sender, EventArgs e)
        {
            CompanyId             = this.SiteUserInfo.CompanyID;
            this.ImgSave.ImageUrl = ImageManage.GetImagerServerUrl(1) + "/images/jipiao/bc_btn.jpg";
            // 初始化旅客类型
            BindVisitorType();
            //绑定证件类型
            BindCardType();
            //初始化国家
            InitCountryList();

            if (!string.IsNullOrEmpty(Utils.InputText(Context.Request.QueryString["EditId"])))
            {
                EditId = Utils.GetString(Context.Request.QueryString["EditId"], "");
            }
            if (!Page.IsPostBack)
            {
                //根据旅客ID获得常旅客实体对象
                EyouSoft.Model.TicketStructure.TicketVistorInfo TicketVisitorInfo = EyouSoft.BLL.TicketStructure.TicketVisitor.CreateInstance().GetTicketVisitorInfo(EditId.ToString());

                this.Master.Naviagtion = AirTicketNavigation.机票常旅客管理;
                this.Title             = "常旅客添加_机票";

                #region 初始化表单数据
                if (TicketVisitorInfo != null)
                {
                    this.ddlCardType.SelectedValue     = ((int)TicketVisitorInfo.CardType).ToString();
                    this.ddlVisitoryType.SelectedValue = ((int)TicketVisitorInfo.VistorType).ToString();
                    this.ddlCountry.SelectedValue      = ((int)TicketVisitorInfo.NationInfo.NationId).ToString();
                    this.txtCardNo.Value = TicketVisitorInfo.CardNo.Trim();
                    this.txtCname.Value  = TicketVisitorInfo.ChinaName.Trim();
                    this.txtEname.Value  = TicketVisitorInfo.EnglishName.Trim();
                    this.txtPhone.Value  = TicketVisitorInfo.ContactTel.Trim();
                    this.txtRemark.Value = TicketVisitorInfo.Remark.Trim();
                    EyouSoft.Model.CompanyStructure.Sex Gender = TicketVisitorInfo.ContactSex;
                    if (Gender == EyouSoft.Model.CompanyStructure.Sex.男)
                    {
                        this.gender_male.Checked = true;
                    }
                    else
                    {
                        this.gender_female.Checked = true;
                    }
                }
                //释放资源
                TicketVisitorInfo = null;
                #endregion
            }
        }
コード例 #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // 初始化旅客类型
            BindVisitorType();
            //绑定证件类型
            BindCardType();
            //初始化国家
            InitCountryList();
            string method = Utils.GetFormValue("method");

            if (!string.IsNullOrEmpty(Utils.InputText(Context.Request.QueryString["EditId"])))
            {
                EditId = Utils.GetString(Context.Request.QueryString["EditId"], "");
                this.hvp_hfEditId.Value = EditId;
            }

            if (method == "save")
            {
                SaveHotelVisitors();
                return;
            }

            if (!Page.IsPostBack)
            {
                if (this.SiteUserInfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.其他采购商) && this.SiteUserInfo.CompanyRole.HasRole(EyouSoft.Model.CompanyStructure.CompanyType.组团))
                {
                    Response.Clear();
                    Response.Write("对不起,您没有权限");
                    Response.End();
                    return;
                }


                //根据旅客ID获得常旅客实体对象
                EyouSoft.Model.TicketStructure.TicketVistorInfo HotelVisitorInfo = EyouSoft.BLL.TicketStructure.TicketVisitor.CreateInstance().GetTicketVisitorInfo(EditId);

                #region 初始化表单数据
                if (HotelVisitorInfo != null)
                {
                    FlageName = "修改常旅客";
                    this.hvp_ddlCardType.SelectedValue    = ((int)HotelVisitorInfo.CardType).ToString();
                    this.hvp_ddlVisitorType.SelectedValue = ((int)HotelVisitorInfo.VistorType).ToString();
                    if (HotelVisitorInfo.NationInfo.NationId.ToString() != "")
                    {
                        this.hvp_ddlCountry.SelectedValue = ((int)HotelVisitorInfo.NationInfo.NationId).ToString();
                    }
                    this.hvp_txtChinaName.Value   = HotelVisitorInfo.ChinaName.Trim();
                    this.hvp_txtEnglishName.Value = HotelVisitorInfo.EnglishName.Trim();
                    this.hvp_txtCardNo.Value      = HotelVisitorInfo.CardNo.Trim();
                    this.hvp_txtMobilePhone.Value = HotelVisitorInfo.ContactTel.Trim();
                    this.hvp_txtReamrk.Value      = HotelVisitorInfo.Remark.Trim();
                    EyouSoft.Model.CompanyStructure.Sex Gender = HotelVisitorInfo.ContactSex;
                    if (Gender == EyouSoft.Model.CompanyStructure.Sex.男)
                    {
                        this.hvp_rdoMale.Checked   = true;
                        this.hvp_rdoFemale.Checked = false;
                    }
                    else
                    {
                        this.hvp_rdoFemale.Checked = true;
                        this.hvp_rdoMale.Checked   = false;
                    }
                }
                //释放资源
                HotelVisitorInfo = null;
                #endregion
            }
        }