コード例 #1
0
ファイル: PrintDetail.aspx.cs プロジェクト: windygu/bbl
        protected void Page_Load(object sender, EventArgs e)
        {
            int dutyID = Utils.GetInt(Request.QueryString["DutyID"], -1);

            if (!IsPostBack)
            {
                if (dutyID != -1)
                {
                    EyouSoft.BLL.AdminCenterStructure.RuleInfo   bllRuleInfo   = new EyouSoft.BLL.AdminCenterStructure.RuleInfo();
                    EyouSoft.Model.AdminCenterStructure.RuleInfo modelRuleInfo = bllRuleInfo.GetModel(CurrentUserCompanyID, dutyID);
                    if (modelRuleInfo != null)
                    {
                        DutyNo              = modelRuleInfo.RoleNo;
                        DutyTitle           = modelRuleInfo.Title;
                        Content             = modelRuleInfo.RoleContent;
                        this.noData.Visible = false;
                    }
                    else
                    {
                        this.noData.Visible = true;
                    }
                }
                else
                {
                    this.noData.Visible = true;
                }
            }
        }
コード例 #2
0
ファイル: AjaxBylaw.aspx.cs プロジェクト: windygu/bbl
        /// <summary>
        /// 绑定数据
        /// </summary>
        private void BindData()
        {
            EyouSoft.BLL.AdminCenterStructure.RuleInfo           bllRuleInfo  = new EyouSoft.BLL.AdminCenterStructure.RuleInfo();
            IList <EyouSoft.Model.AdminCenterStructure.RuleInfo> ListRuleInfo = bllRuleInfo.GetList(PageSize, PageIndex, ref RecordCount, CurrentUserCompanyID, Number, RegentTitle);

            if (ListRuleInfo != null && ListRuleInfo.Count > 0)
            {
                this.crptBylawList.DataSource = ListRuleInfo;
                this.crptBylawList.DataBind();
                this.BindPage();
            }
            else
            {
                this.crptBylawList.EmptyText      = "<tr><td colspan=\"3\"><div style=\"text-align:center;  margin-top:75px; margin-bottom:75px;\">没有相关的数据!</span></div></td></tr>";
                this.ExporPageInfoSelect1.Visible = false;
            }
        }
コード例 #3
0
ファイル: AjaxBylaw.aspx.cs プロジェクト: windygu/bbl
        protected void Page_Load(object sender, EventArgs e)
        {
            string method = Utils.GetQueryStringValue("Method");
            int    dutyID = Utils.GetInt(Request.QueryString["DutyID"], -1);

            PageIndex = Utils.GetInt(Request.QueryString["Page"], -1);

            if (!IsPostBack && method == "")
            {
                if (CheckGrant(global::Common.Enum.TravelPermission.行政中心_规章制度_修改制度))
                {
                    EditFlag = true;
                }
                if (CheckGrant(global::Common.Enum.TravelPermission.行政中心_规章制度_删除制度))
                {
                    DelateFlag = true;
                }
                Number      = Utils.GetQueryStringValue("Number");
                RegentTitle = Utils.GetQueryStringValue("RegentTitle");
                BindData();
            }
            if (method == "DeleteDuty" && dutyID != -1)//删除
            {
                EyouSoft.BLL.AdminCenterStructure.RuleInfo bllRuleInfo = new EyouSoft.BLL.AdminCenterStructure.RuleInfo();
                if (bllRuleInfo.Delete(CurrentUserCompanyID, dutyID))
                {
                    Response.Clear();
                    Response.Write("True");
                    Response.End();
                }
                else
                {
                    Response.Clear();
                    Response.Write("False");
                    Response.End();
                }
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            int    dutyID = Utils.GetInt(Request.QueryString["DutyID"], -1); //制度ID
            string method = Utils.GetFormValue("hidMethod");

            if (!IsPostBack && method == "")
            {
                this.hidDutyID.Value = dutyID.ToString();
                if (dutyID != -1)
                {
                    EyouSoft.BLL.AdminCenterStructure.RuleInfo   bllRuleInfo   = new EyouSoft.BLL.AdminCenterStructure.RuleInfo();
                    EyouSoft.Model.AdminCenterStructure.RuleInfo modelRuleInfo = bllRuleInfo.GetModel(CurrentUserCompanyID, dutyID);
                    if (modelRuleInfo != null)
                    {
                        Number      = modelRuleInfo.RoleNo;
                        RegentTitle = modelRuleInfo.Title;
                        this.txt_RegentContent.Value = modelRuleInfo.RoleContent;

                        if (modelRuleInfo.FilePath != "")
                        {
                            FileHref = modelRuleInfo.FilePath;
                            this.hidFileValue.Value = modelRuleInfo.FilePath;
                            file.Visible            = true;
                        }
                        else
                        {
                            file.Visible = false;
                        }
                    }
                    else
                    {
                        MessageBox.Show(this.Page, "没有该规章制度信息");
                        return;
                    }
                }
            }

            if (method == "save")       //保存
            {
                Number        = Utils.GetFormValue("txt_Number");
                RegentTitle   = Utils.GetFormValue("txt_RegentTitle");
                RegentContent = Utils.EditInputText(Request.Form["txt_RegentContent"]);
                if (RegentTitle == "")
                {
                    MessageBox.Show(this.Page, "制度标题不能为空!");
                    return;
                }

                HttpPostedFile hpf      = this.Request.Files["file_Bylaw"];
                string         oldeFile = string.Empty;
                string         fileName = string.Empty;
                if (hpf != null && hpf.ContentLength > 0)
                {
                    if (UploadFile.FileUpLoad(hpf, "AdminCenterRuleInfo", out fileName, out oldeFile))
                    {
                        FileHref = fileName;
                    }
                    else
                    {
                        MessageBox.Show(this.Page, "附加上传失败!");
                        return;
                    }
                }
                else
                {
                    FileHref = this.hidFileValue.Value;
                }
                EyouSoft.Model.AdminCenterStructure.RuleInfo modelRuleInfo = new EyouSoft.Model.AdminCenterStructure.RuleInfo();
                EyouSoft.BLL.AdminCenterStructure.RuleInfo   bllRuleInfo   = new EyouSoft.BLL.AdminCenterStructure.RuleInfo();
                modelRuleInfo.RoleNo      = Number;
                modelRuleInfo.Title       = RegentTitle;
                modelRuleInfo.RoleContent = RegentContent;
                modelRuleInfo.FilePath    = FileHref;
                modelRuleInfo.CompanyId   = CurrentUserCompanyID;

                if (dutyID == -1)
                {
                    if (!CheckGrant(global::Common.Enum.TravelPermission.行政中心_规章制度_新增制度))
                    {
                        Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.行政中心_规章制度_新增制度, true);
                    }
                    if (bllRuleInfo.Add(modelRuleInfo))
                    {
                        MessageBox.ResponseScript(this, string.Format("alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();window.parent.location='{2}';", "保存成功!", Utils.GetQueryStringValue("iframeId"), "/administrativeCenter/bylaw/Default.aspx"));
                    }
                    else
                    {
                        MessageBox.Show(this.Page, "保存失败!");
                    }
                }
                else if (dutyID != -1)
                {
                    if (!CheckGrant(global::Common.Enum.TravelPermission.行政中心_规章制度_修改制度))
                    {
                        Utils.ResponseNoPermit(global::Common.Enum.TravelPermission.行政中心_规章制度_修改制度, true);
                    }
                    modelRuleInfo.Id = dutyID;
                    if (bllRuleInfo.Update(modelRuleInfo))
                    {
                        MessageBox.ResponseScript(this, string.Format("alert('{0}');window.parent.Boxy.getIframeDialog('{1}').hide();window.parent.location='{2}';", "修改成功!", Utils.GetQueryStringValue("iframeId"), "/administrativeCenter/bylaw/Default.aspx"));
                    }
                    else
                    {
                        MessageBox.Show(this.Page, "修改失败!");
                    }
                }
            }
        }