Exemple #1
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string id, string dotype)
        {
            string star = string.Empty;

            this.txtaddress.Text          = "";
            this.txtHotelDesc.Text        = "";
            this.txtRemarks.Text          = "";
            this.txtHotelName.Text        = "";
            this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId;
            this.UploadControl2.CompanyID = this.SiteUserInfo.CompanyId;
            this.txtLastHuman.Text        = this.SiteUserInfo.Name;
            if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id))
            {
                EyouSoft.BLL.SourceStructure.BSource        BLL   = new EyouSoft.BLL.SourceStructure.BSource();
                EyouSoft.Model.SourceStructure.MSourceHotel model = BLL.GetOneHotelModel(id);
                if (model != null)
                {
                    if (model.SourceModel != null)
                    {
                        this.txtaddress.Text            = model.SourceModel.Address;
                        this.txtHotelDesc.Text          = model.SourceModel.Desc;
                        this.txtHotelName.Text          = model.SourceModel.Name;
                        this.txtRemarks.Text            = model.SourceModel.Remark;
                        this.txtContractDate_Start.Text = UtilsCommons.SetDateTimeFormart(model.SourceModel.ContractPeriodStart);
                        this.txtContractDate.Text       = UtilsCommons.SetDateTimeFormart(model.SourceModel.ContractPeriodEnd);
                        this.txtLastHuman.Text          = model.SourceModel.LastModifierId;
                        this.txtLastDate.Text           = UtilsCommons.GetDateString(model.SourceModel.LastModifyTime, ProviderToDate);
                        if (model.SourceModel.ContractAttach != null)
                        {
                            StringBuilder strFile = new StringBuilder();
                            if (model.SourceModel.ContractAttach.FilePath != "")
                            {
                                strFile.AppendFormat("<span class='upload_filename'><a href='/CommonPage/FileDownLoad.aspx?doType=downLoad&filePath={0}&name={1}' target='_blank'>{1}</a><a href=\"javascript:void(0)\" onclick=\"Controlwine.DelFile(this)\" title='删除附件'><img style='vertical-align:middle' src='/images/cha.gif'></a><input type=\"hidden\" name=\"hideFileInfo\" value='{1}|{0}'/></span>", model.SourceModel.ContractAttach.FilePath, model.SourceModel.ContractAttach.Name);
                            }
                            this.lbFiles.Text = strFile.ToString();
                        }
                        star = Convert.ToString((int)model.Star);
                        //签单
                        radno.Checked = true;
                        if (model.SourceModel.IsPermission)
                        {
                            radyes.Checked = true;
                            radno.Checked  = false;
                        }
                        //返佣
                        RadioButton2.Checked = true;
                        if (model.SourceModel.IsCommission)
                        {
                            RadioButton1.Checked = true;
                            RadioButton2.Checked = false;
                        }
                        //推荐
                        radRecommendno.Checked = true;
                        if (model.SourceModel.IsRecommend)
                        {
                            radRecommendyes.Checked = true;
                            radRecommendno.Checked  = false;
                        }
                        //合同
                        Radio_hd_no.Checked = true;
                        if (model.SourceModel.IsSignContract)
                        {
                            Radio_hd_yes.Checked        = true;
                            Radio_hd_no.Checked         = false;
                            this.txtContractNum.Visible = true;
                            this.txtContractNum.Text    = model.SourceModel.ContractCode;
                        }

                        Countryindex  = model.SourceModel.CountryId;
                        Provinceindex = model.SourceModel.ProvinceId;
                        Cityindex     = model.SourceModel.CityId;
                        Areaindex     = model.SourceModel.CountyId;
                    }
                    this.txtTel.Text = model.ReceptionTel;
                    if (model.LinkManList.Count > 0)
                    {
                        this.Contact1.SetTravelList = model.LinkManList;
                    }
                    if (model.HotelRoomList.Count > 0)
                    {
                        SetHotelList = model.HotelRoomList;
                    }
                    SetListCount = SetHotelList.Count;
                    IList <EyouSoft.Model.ComStructure.MComAttach> imglist = model.AttachList;
                    if (imglist != null && imglist.Count > 0)
                    {
                        listCount = imglist.Count;
                        this.rplimg.DataSource = imglist;
                        this.rplimg.DataBind();
                    }
                }
                else
                {
                    Utils.ResponseGoBack();
                }
            }

            this.txtLastDate.Enabled  = false;
            this.txtLastHuman.Enabled = false;
            this.litStar.Text         = UtilsCommons.GetEnumDDL(EyouSoft.Common.EnumObj.GetList(typeof(EyouSoft.Model.EnumType.SourceStructure.HotelStar)), star, false);
        }