Пример #1
0
        /// <summary>
        /// 页面初始化
        /// </summary>
        /// <param name="id">操作ID</param>
        protected void PageInit(string id, string dotype)
        {
            this.UploadControl1.CompanyID = this.SiteUserInfo.CompanyId;
            this.txtLastHuman.Text        = this.SiteUserInfo.Name;
            this.txtLastDate.Enabled      = false;
            this.txtLastHuman.Enabled     = false;

            if (String.Equals(dotype, "update", StringComparison.InvariantCultureIgnoreCase) && !string.IsNullOrEmpty(id))
            {
                EyouSoft.BLL.SourceStructure.BSource         bll   = new EyouSoft.BLL.SourceStructure.BSource();
                EyouSoft.Model.SourceStructure.MSourceDining model = bll.GetDiningModel(id);
                if (model != null)
                {
                    if (model.SourceModel != null)
                    {
                        Countryindex                    = model.SourceModel.CountryId;
                        Provinceindex                   = model.SourceModel.ProvinceId;
                        Cityindex                       = model.SourceModel.CityId;
                        Areaindex                       = model.SourceModel.CountyId;
                        this.txtaddress.Text            = model.SourceModel.Address;
                        this.txthotleinfo.Text          = model.SourceModel.Desc;
                        this.txtHotleName.Text          = model.SourceModel.Name;
                        this.txtRemarks.Text            = model.SourceModel.Remark;
                        this.txtContractDate.Text       = UtilsCommons.GetDateString(model.SourceModel.ContractPeriodEnd, ProviderToDate);
                        this.txtContractDate_Start.Text = UtilsCommons.GetDateString(model.SourceModel.ContractPeriodStart, ProviderToDate);
                        this.txtLastDate.Text           = UtilsCommons.GetDateString(model.SourceModel.LastModifyTime, ProviderToDate);
                        this.txtLastHuman.Text          = model.SourceModel.LastModifierId;
                        string cuisinename = string.Empty;
                        string cuisineid   = string.Empty;
                        if (model.DiningCuisineList != null && model.DiningCuisineList.Count > 0)
                        {
                            for (int i = 0; i < model.DiningCuisineList.Count; i++)
                            {
                                if (model.DiningCuisineList.Count - 1 == i)
                                {
                                    cuisinename += model.DiningCuisineList[i].Cuisine.ToString();
                                    cuisineid   += ((int)model.DiningCuisineList[i].Cuisine).ToString();
                                }
                                else
                                {
                                    cuisinename += model.DiningCuisineList[i].Cuisine.ToString() + ",";
                                    cuisineid   += ((int)model.DiningCuisineList[i].Cuisine).ToString() + ",";
                                }
                            }
                        }
                        this.CuisineSelect1.CuisineSelectName = cuisinename;
                        this.CuisineSelect1.CuisineSelectID   = cuisineid;

                        radno.Checked = true;
                        if (model.SourceModel.IsCommission)
                        {
                            radyes.Checked = true;
                            radno.Checked  = false;
                        }
                        Radio_hd_no.Checked = true;
                        if (model.SourceModel.IsSignContract)
                        {
                            Radio_hd_yes.Checked        = true;
                            this.Radio_hd_no.Checked    = false;
                            this.txtContractNum.Visible = true;
                            this.txtContractNum.Text    = model.SourceModel.ContractCode;
                        }
                        RadRecommend_no.Checked = true;
                        if (model.SourceModel.IsRecommend)
                        {
                            RadRecommend_yes.Checked = true;
                            RadRecommend_no.Checked  = false;
                        }
                        RadSign_no.Checked = true;
                        if (model.SourceModel.IsPermission)
                        {
                            RadSign_yes.Checked = true;
                            RadSign_no.Checked  = false;
                        }
                        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=\"CruiseEditPage.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();
                        }
                    }
                    if (!string.IsNullOrEmpty(model.DiningStandard) && model.DiningStandard.Split('-').Length > 1)
                    {
                        this.txtPmax.Text = model.DiningStandard.Split('-')[1].Replace("元", "");
                        this.txtPmin.Text = model.DiningStandard.Split('-')[0].Replace("元", "");
                    }
                    if (model.LinkManList.Count > 0)
                    {
                        this.Contact1.SetTravelList = model.LinkManList;
                    }
                }
                else
                {
                    Utils.ResponseGoBack();
                }
            }
        }