Пример #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            EyouSoft.Model.SiteStructure.TicketPolicy ssModel = new EyouSoft.Model.SiteStructure.TicketPolicy();
            EyouSoft.BLL.SiteStructure.TicketPolicy   ssBLL   = new EyouSoft.BLL.SiteStructure.TicketPolicy();

            //判断权限
            if (!CheckGrant(global::Common.Enum.TravelPermission.系统设置_同行平台栏目))
            {
                Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.系统设置_同行平台栏目, false);
                return;
            }
            if (!IsPostBack)
            {
                //修改时加载原有数据
                if (Utils.GetQueryStringValue("type") == "modify")
                {
                    //获取id
                    id = Utils.GetInt(Utils.GetQueryStringValue("tid"));
                    //获取model
                    ssModel = ssBLL.GetTicketPolicy(id, SiteUserInfo.CompanyID);
                    //机票政策内容
                    txt_Contert.Text = ssModel.Content;
                    //机票政策Title
                    txt_Title.Text = ssModel.Title;
                    //附件路劲
                    filePath = ssModel.FilePath;
                }
            }
        }
Пример #2
0
        /// <summary>
        /// 初始化列表
        /// </summary>
        private void Content()
        {
            //判断 当前域名是否是专线系统为组团配置的域名
            EyouSoft.Model.SysStructure.SystemDomain domain = new EyouSoft.BLL.SysStructure.SystemDomain().GetDomain(Request.Url.Host.ToLower());
            //获取机票政策id
            int id = Utils.GetInt(Utils.GetQueryStringValue("id"));

            //机票政策BLL
            EyouSoft.BLL.SiteStructure.TicketPolicy ssBLL = new EyouSoft.BLL.SiteStructure.TicketPolicy();
            //机票政策Model
            EyouSoft.Model.SiteStructure.TicketPolicy ssModel = new EyouSoft.Model.SiteStructure.TicketPolicy();
            //获取机票政策实体
            ssModel = ssBLL.GetTicketPolicy(id, domain.CompanyId);
            if (ssModel != null)
            {
                //显示机票政策
                lblContent.Text = ssModel.Content;
                //显示标题
                lblTitle.Text = ssModel.Title;
                //显示时间
                //lblDate.Text=ssModel.
                //获取附件
                if (ssModel.FilePath.Trim() != "")
                {
                    linkFilePath.NavigateUrl = ssModel.FilePath;
                    linkFilePath.Visible     = true;
                }
            }
        }
Пример #3
0
        private void bind()
        {
            //初使化条件
            pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
            //机票政策BLL
            EyouSoft.BLL.SiteStructure.TicketPolicy ssBLL = new EyouSoft.BLL.SiteStructure.TicketPolicy();
            //机票政策List
            IList <EyouSoft.Model.SiteStructure.TicketPolicy> list = null;

            //判断 当前域名是否是专线系统为组团配置的域名
            EyouSoft.Model.SysStructure.SystemDomain domain = new EyouSoft.BLL.SysStructure.SystemDomain().GetDomain(Request.Url.Host.ToLower());
            //获取机票政策列表
            list = ssBLL.GetTicketPolicy(domain.CompanyId, pageSize, pageIndex, ref recordCount);
            //绑定机票政策
            rptList.DataSource = list;
            rptList.DataBind();
            //判断列表是否为空
            if (list != null && list.Count == 0)
            {
                lbl_msg.Visible = true;
            }
            else
            {
                lbl_msg.Visible = false;
            }
            //分页
            BindPage();
        }
Пример #4
0
 /// <summary>
 /// 初始化绑定列表
 /// </summary>
 private void bind()
 {
     //机票政策BLL
     EyouSoft.BLL.SiteStructure.TicketPolicy ssBLL = new EyouSoft.BLL.SiteStructure.TicketPolicy();
     //分页页数
     pageIndex = Utils.GetInt(Utils.GetQueryStringValue("page"), 1);
     //获取机票政策列表
     list = ssBLL.GetTicketPolicy(SiteUserInfo.CompanyID, pageSize, pageIndex, ref recordCount);
     //绑定数据
     rptList.DataSource = list;
     rptList.DataBind();
     //记录条数
     len = list.Count;
     //设置分页
     BindPage();
 }
Пример #5
0
        /// <summary>
        /// 保存操作
        /// </summary>
        /// <param name="Y">bool 保存or保存并继续添加 </param>
        private void Save()
        {
            //初始化Model
            EyouSoft.Model.SiteStructure.TicketPolicy ssModel = new EyouSoft.Model.SiteStructure.TicketPolicy();
            //初始化BLL
            EyouSoft.BLL.SiteStructure.TicketPolicy ssBLL = new EyouSoft.BLL.SiteStructure.TicketPolicy();
            if (txt_Title.Text.Trim() == "")//验证标题不能为空
            {
                MessageBox.ResponseScript(this, Utils.ShowMsg("标题不能为空!"));
                lit_Title.Text = "标题不能为空!";
                return;
            }
            ///////////修改状态填充原有数据
            //判断操作
            if (Utils.GetQueryStringValue("type") == "modify")//修改操作
            {
                //获取id
                id = Utils.GetInt(Utils.GetFormValue("tid"));
                //获取Model
                ssModel = ssBLL.GetTicketPolicy(id, SiteUserInfo.CompanyID);
            }
            /////////////////////
            ////////////////////model赋值
            ssModel.CompanyId = SiteUserInfo.CompanyID;
            //内容
            ssModel.Content = txt_Contert.Text;
            //判断上传控件个数
            if (Request.Files.Count > 0)
            {
                //上传文件名
                string oldfilename = string.Empty;
                //上传文件路劲
                string filepath = string.Empty;
                //上传文件
                bool result = EyouSoft.Common.Function.UploadFile.FileUpLoad(Request.Files["workAgree"], "SupplierControlFile", out filepath, out oldfilename);
                if (result)
                {
                    //附件路径赋值
                    ssModel.FilePath = filepath;
                }
            }
            ssModel.Title = Utils.GetFormValue("txt_Title");
            bool res = false;//数据 保存是否成功,默认保存失败

            if (id > 0)
            {
                res = ssBLL.UpdateTicketPolicy(ssModel);//修改
            }
            else
            {
                res = ssBLL.AddTicketPolicy(ssModel);//添加
            }

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