Ejemplo n.º 1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request["head"]))
            {
                GridPanel1.TopBar[0].Visible = false;
                if (Request["head"].Trim() == "0")
                {
                    GridPanel1.Header = false;
                    GridPanel1.Height = 160;
                }
                if (Request["head"].Trim() == "1")
                {
                    GridPanel1.Height = 300;
                }
                Window1.Listeners.BeforeShow.Fn = "function(el) { el.setHeight(Ext.getBody().getViewSize().height-20);el.setWidth(Ext.getBody().getViewSize().width-20); }";
            }
            dfBegin.SelectedDate = System.DateTime.Today.AddDays(1 - System.DateTime.Today.Day);
            dfEnd.SelectedDate   = System.DateTime.Today;
            //dfBegin.MaxDate = System.DateTime.Today;
            //dfEnd.MaxDate = System.DateTime.Today;
            #region 初始化单位
            DBSCMDataContext dc = new DBSCMDataContext();
            if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0"))
            {
                //var dept = from d in dc.Department
                //           where d.Deptnumber.Substring(4) == "00000" && d.Deptname.EndsWith("矿")
                //           select new
                //           {
                //               d.Deptname,
                //               Deptid = d.Deptnumber
                //           };

                UnitStore.DataSource = PublicCode.GetMaindept("");
                UnitStore.DataBind();
                cbbUnit.SelectedItem.Value = "-1";
                cbbUnit.Disabled           = false;
            }
            else
            {
                var dept = from d in dc.Department
                           where d.Deptnumber == SessionBox.GetUserSession().DeptNumber
                           select new
                {
                    d.Deptname,
                    Deptid = d.Deptnumber
                };
                UnitStore.DataSource = dept;
                UnitStore.DataBind();
                cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
                cbbUnit.Disabled           = true;
            }
            #endregion
            //storebind();//第一次不加载
        }
    }
 private void BaseLoad()
 {
     UnitStore.DataSource = PublicCode.GetMaindept("");
     UnitStore.DataBind();
     if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
     {
         cbbUnit.SelectedItem.Value = "241700000";
         cbbUnit.Disabled           = false;
     }
     else
     {
         cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
         cbbUnit.Disabled           = true;
     }
 }
Ejemplo n.º 3
0
    private void SearchLoad()//查询窗口初始化
    {
        //初始化日期
        df_begin.SelectedDate = System.DateTime.Today.AddDays(-2);
        df_end.SelectedDate   = System.DateTime.Today;
        #region 初始化部门
        var dep = from d in dc.Department
                  from p in dc.Person
                  where d.Deptnumber == p.Areadeptid && p.Maindeptid == SessionBox.GetUserSession().DeptNumber
                  select new
        {
            DeptName = d.Deptname,
            DeptID   = d.Deptnumber
        };
        DeptStore.DataSource = dep;
        DeptStore.DataBind();
        #endregion

        #region 初始化单位
        if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
        {
            UnitStore.DataSource = PublicCode.GetMaindept("");
            UnitStore.DataBind();
            cbbUnit.Disabled = false;

            cbb_part.Disabled = true;
        }
        else
        {
            var dept = from d in dc.Department
                       where d.Deptnumber == SessionBox.GetUserSession().DeptNumber
                       select new
            {
                d.Deptname,
                d.Deptnumber
            };
            UnitStore.DataSource = dept;
            UnitStore.DataBind();
            cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
            cbbUnit.Disabled           = true;
        }
        #endregion
    }
Ejemplo n.º 4
0
    private void SearchLoad()//查询窗口初始化
    {
        //初始化日期
        df_begin.SelectedDate = System.DateTime.Today.AddDays(-15);
        df_end.SelectedDate   = System.DateTime.Today;
        #region 初始化部门
        DeptStore.DataSource = PublicCode.GetKQdept(SessionBox.GetUserSession().DeptNumber);
        DeptStore.DataBind();
        #endregion

        #region 初始化单位
        if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
        {
            UnitStore.DataSource = PublicCode.GetMaindept("");
            UnitStore.DataBind();
            cbbUnit.Disabled = false;

            cbb_part.Disabled = true;
        }
        else
        {
            UnitStore.DataSource = PublicCode.GetMaindept(SessionBox.GetUserSession().DeptNumber);
            UnitStore.DataBind();
            cbbUnit.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
            cbbUnit.Disabled           = true;
        }
        #endregion
        //三违级别
        var lavel = from c in dc.CsBaseinfoset
                    where c.Fid == int.Parse(PublicMethod.ReadXmlReturnNode("SWJB", this))
                    select new
        {
            SWLevelID = c.Infoid,
            SWLevel   = c.Infoname
        };
        LevelStore.DataSource = lavel;
        LevelStore.DataBind();
    }
Ejemplo n.º 5
0
 private void BindData()//基础信息绑定
 {
     if (SessionBox.GetUserSession().rolelevel.Trim().IndexOf("1") > -1)
     {
         Store5.DataSource = PublicCode.GetMaindept("");
         Store5.DataBind();
         cbbDept.SelectedItem.Value = "241700000";
         cbbDept.Disabled           = false;
     }
     else
     {
         var dept = from d in db.Department
                    where d.Deptnumber == SessionBox.GetUserSession().DeptNumber
                    select new
         {
             d.Deptname,
             Deptid = d.Deptnumber
         };
         Store5.DataSource = dept;
         Store5.DataBind();
         cbbDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
         cbbDept.Disabled           = true;
     }
 }
Ejemplo n.º 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Ext.IsAjaxRequest)
        {
            #region 初始化单位
            MainDeptStore.DataSource = PublicCode.GetMaindept("");
            MainDeptStore.DataBind();

            if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0"))
            {
                cbbKQ.Disabled     = true;
                cbbPerson.Disabled = true;
            }
            else
            {
                cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
                cbbMianDept.Disabled           = true;
                KQStore.DataSource             = PublicCode.GetKQdept(SessionBox.GetUserSession().DeptNumber);
                KQStore.DataBind();
                cbbPerson.Disabled = true;
            }
            #endregion
        }
    }
Ejemplo n.º 7
0
    private void BaseSet()
    {
        HBBLL hb = new HBBLL();

        var data = hb.GetLeaderRole(SessionBox.GetUserSession().DeptNumber, 431);
        var q    = from p in data
                   select new
        {
            Personnumber = p.personnumber,
            Name         = p.name
        };

        perStore.DataSource = q;
        perStore.DataBind();
        if (SessionBox.GetUserSession().Role.Contains("11,矿级管理员"))
        {
            //cbbPerson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber;
            if (SessionBox.GetUserSession().Role.Contains("431,副总及以上领导"))
            {
                cbbPerson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber;
                cbbPerson.Disabled           = false;
            }
            else
            {
                cbbPerson.SelectedIndex = 0;
            }
        }
        else
        {
            cbbPerson.Items.Add(new Coolite.Ext.Web.ListItem(SessionBox.GetUserSession().Name, SessionBox.GetUserSession().PersonNumber));
            cbbPerson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber;
            cbbPerson.Disabled           = true;
        }
        df_begin.MinDate      = System.DateTime.Today;
        df_begin.SelectedDate = df_begin.MinDate;
        //cx_date.SelectedDate = System.DateTime.Today;
        //var q = from p in dc.Person
        //        where p.Personnumber==SessionBox.GetUserSession().PersonNumber
        //        select new
        //        {
        //            p.Personnumber,
        //            p.Name
        //        };
        //perStore.DataSource = q;
        //perStore.DataBind();


        DeptStore.DataSource = PublicCode.GetMaindept("");
        DeptStore.DataBind();
        if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0"))
        {
            cbbDept.Items.Insert(0, new Coolite.Ext.Web.ListItem("--全部--", "-1"));
            cbbDept.SelectedItem.Value = "-1";
            cbbDept.Disabled           = false;
        }
        else
        {
            cbbDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
            cbbDept.Disabled           = true;
        }
        //HBBLL hb = new HBBLL();

        //var data2 = hb.GetYPPT(SessionBox.GetUserSession().PersonNumber, SessionBox.GetUserSession().DeptNumber, "个人");
        //var pt = from r in data2
        //         select new
        //         {
        //             Id = r.Id,
        //             Name = r.Name,
        //             Level = r.TLevel
        //         };
        //placeTemplateStore.DataSource = pt;
        //placeTemplateStore.DataBind();
        //cboPlaceTemplate.Items.Insert(0, new Coolite.Ext.Web.ListItem("--不使用模板--", "-1"));
        cx_date.SelectedValue = DateTime.Today;
    }
Ejemplo n.º 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Ext.IsAjaxRequest)
        {
            UserHandle.InitModule(this.PageTag);                   //初始化此模块的权限。
            if (UserHandle.ValidationHandle(PermissionTag.Browse)) //是否有浏览权限
            {
                dfBegin.SelectedDate = System.DateTime.Today.AddDays(1 - System.DateTime.Today.Day);
                dfEnd.SelectedDate   = System.DateTime.Today;
                //dfBegin.MaxDate = System.DateTime.Today;
                //dfEnd.MaxDate = System.DateTime.Today;

                #region 初始化单位
                MainDeptStore.DataSource = PublicCode.GetMaindept("");
                MainDeptStore.DataBind();
                KQStore.DataSource = PublicCode.GetKQdept(SessionBox.GetUserSession().DeptNumber);
                KQStore.DataBind();
                if (SessionBox.GetUserSession().rolelevel.Contains("1") || SessionBox.GetUserSession().rolelevel.Contains("0"))
                {
                    cbbKQ.Disabled = true;
                }
                else
                {
                    cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
                    cbbMianDept.Disabled           = true;
                }

                #endregion
                //LoadData();
                if (UserHandle.ValidationHandle(PermissionTag.SearchAll))
                {
                    cbbMianDept.Disabled = false;
                    cbbKQ.Disabled       = false;
                    btnSearch.Disabled   = false;
                }
                else if (UserHandle.ValidationHandle(PermissionTag.SearchMainDept))
                {
                    cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
                    cbbMianDept.Disabled           = true;
                    cbbKQ.Disabled     = false;
                    btnSearch.Disabled = false;
                }
                else if (UserHandle.ValidationHandle(PermissionTag.SearchDept))
                {
                    cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
                    cbbMianDept.Disabled           = true;
                    cbbKQ.SelectedItem.Value       = PublicCode.GetKQdeptNumber(SessionBox.GetUserSession().PersonNumber);
                    cbbKQ.Disabled     = true;
                    btnSearch.Disabled = false;
                }
                else if (UserHandle.ValidationHandle(PermissionTag.SearchPersonal))
                {
                    cbbMianDept.SelectedItem.Value = SessionBox.GetUserSession().DeptNumber;
                    cbbMianDept.Disabled           = true;
                    cbbKQ.SelectedItem.Value       = PublicCode.GetKQdeptNumber(SessionBox.GetUserSession().PersonNumber);
                    cbbKQ.Disabled     = true;
                    btnSearch.Disabled = false;
                }
                else
                {
                    btnSearch.Disabled = true;
                }
            }
            else
            {
                Session["ErrorNum"] = "0";
                Response.Redirect("~/Error.aspx");
            }
        }
    }