Пример #1
0
    protected void BindGrid()
    {
        this.TypeHid.Value = "2";

        DataTable dt = UserAccess.GetAdminUserList();

        AdminList.DataSource = dt;
        AdminList.DataBind();
        this.Label1.Text = "记录:" + dt.Rows.Count;
    }
Пример #2
0
    protected void BindGrid()
    {
        this.TypeHid.Value = "2";

        DataTable lists = bll.GetUserList();

        AdminList.DataSource = lists;
        AdminList.DataBind();
        this.Label1.Text = "记录:" + lists.Rows.Count;
    }
Пример #3
0
    protected void PopulateControls()
    {
        this.TypeHid.Value = "0";

        DataTable dt = UserAccess.GetAdminUserListByDate(date);

        AdminList.DataSource = dt;
        AdminList.DataBind();
        this.Label1.Text = "记录:" + dt.Rows.Count;
    }
Пример #4
0
    private void PopulateControls()
    {
        this.TypeHid.Value = "0";

        DateTime beginDate = curDate.Date;
        DateTime endDate   = curDate.AddDays(1).Date;

        DataTable lists = bll.GetUserListByDate(beginDate, endDate);

        AdminList.DataSource = lists;
        AdminList.DataBind();
        this.Label1.Text = "记录:" + lists.Rows.Count;
    }
Пример #5
0
    private void Bind()
    {
        StudentList.DataSource = bllStudent.GetAll();
        StudentList.DataBind();

        if (CheckAdmin())
        {
            AdminList.DataSource = bllAdmin.GetNotAdmin();
            AdminList.DataBind();
        }
        else
        {
            AdminPanel.Visible = false;
        }
    }
Пример #6
0
    //搜索按钮
    protected void Button4_Click(object sender, EventArgs e)
    {
        string keywords = this.KeyBox.Text.Trim().Replace("%", "");

        if (keywords == "")
        {
            Utility.Alert(this, "关键字不能为空!");
            return;
        }

        this.TypeHid.Value = "1";

        DataTable dt = UserAccess.GetAdminUserListByKeywords(keywords);

        AdminList.AllowPaging = false;
        AdminList.PageIndex   = 0;
        AdminList.DataSource  = dt;
        AdminList.DataBind();
        this.Label1.Text = "记录:" + dt.Rows.Count;
    }
Пример #7
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             Butonvisible(true);
             panelVisible(false, true, false, false);
         }
         Users user = (Users)Session["user"];
         AdminList.DataSource = (from u in db.Users where u.ID != user.ID select u).ToList();
         AdminList.DataBind();
         ((Master)this.Master).Path     = "Kullanıcılar";
         ((Master)this.Master).PathLink = "AdminPage.aspx";
     }
     catch (Exception)
     {
         Uyari("Bir hata oluştu", false);
         pnlAlert.Visible = true;
     }
 }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Session["UData"] != null)
            {
                DataSet MyRecDataSet = (DataSet)Session["UData"];
                if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true || Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true)
                {
                    RepYears.DataSource = YearList.DataSource = Obj.GetDataSet("ReportAllYears");
                    YearList.DataBind();
                    RepYears.DataBind();

                    YearList.DataTextField  = "YearName";
                    YearList.DataValueField = "ID";
                    YearList.DataBind();
                }
                else if (Obj.ExecuteProcedureID("CheckSectionManger", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])) == 1)
                {
                    Sections.Attributes.Remove("style");
                    Sections.Attributes.Add("style", "display:none");

                    RepYears.DataSource = YearList.DataSource = Obj.GetDataSetByID("GetPlansBySection", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["SectionID"]));
                    YearList.DataBind();
                    RepYears.DataBind();

                    YearList.DataTextField  = "YearName";
                    YearList.DataValueField = "ID";
                    YearList.DataBind();
                }

                else
                {
                    Response.Redirect("NoPermissions.aspx");
                }
            }
        }

        else
        {
            if (HiddenYear.Value == "1")
            {
                DataSet MyRecDataSet = (DataSet)Session["UData"];

                if (YearList.SelectedIndex == -1)
                {
                    SectorList.Items.Clear();
                    AdminList.Items.Clear();
                    RepYears.DataSource = null;
                    RepYears.DataBind();

                    RepYears.DataSource = Obj.GetDataSet("ReportAllYears");
                    RepYears.DataBind();
                }
                else
                {
                    for (int i = 0; i <= YearList.Items.Count - 1; i++)
                    {
                        if (YearList.Items[i].Selected == true)
                        {
                            // Fill dropdown Lists For Reports Sections تبعا للسنة


                            RepYears.DataSource = null;
                            RepYears.DataBind();
                            RepYears.DataSource = Obj.GetDataSetByID("ReportOneYearAll", Convert.ToInt32(YearList.Items[i].Value));
                            RepYears.DataBind();

                            if (Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["Gov"]) == true || Convert.ToBoolean(MyRecDataSet.Tables[0].Rows[0]["SystemAdmin"]) == true)
                            {
                                SectorList.DataSource = null;
                                SectorList.DataBind();
                                SectorList.DataSource     = Obj.GetDataSetByID("ReportSectionsAllStatusYear", Convert.ToInt32(YearList.Items[i].Value));
                                SectorList.DataTextField  = "SectionName";
                                SectorList.DataValueField = "SectionID";
                                SectorList.DataBind();
                            }
                            else if (Obj.GetDataSetByID("GetSectionsByManager", Convert.ToInt32(MyRecDataSet.Tables[0].Rows[0]["EmpID"])).Tables[0].Rows.Count > 0)
                            {
                            }
                        }
                    }
                }
                HiddenYear.Value = "0";
            }
            if (HiddenSector.Value == "1")
            {
                for (int i = 0; i <= SectorList.Items.Count - 1; i++)
                {
                    if (SectorList.Items[i].Selected == true)
                    {
                        for (int j = 0; j <= YearList.Items.Count - 1; j++)
                        {
                            if (YearList.Items[j].Selected == true)
                            {
                                RepYears.DataSource = null;
                                RepYears.DataBind();
                                RepYears.DataSource = Obj.GetDataSetByID("ReportOneYearAll", Convert.ToInt32(YearList.Items[j].Value));
                                RepYears.DataBind();
                                AdminList.DataSource = null;
                                AdminList.DataBind();

                                AdminList.DataSource     = Obj.GetDataSetBy2ID("RepAllAdminsByStatIDYear", Convert.ToInt32(YearList.Items[j].Value), Convert.ToInt32(SectorList.Items[i].Value));
                                AdminList.DataTextField  = "AdmName";
                                AdminList.DataValueField = "AdmID";
                                AdminList.DataBind();
                            }
                        }
                    }
                }
                HiddenSector.Value = "0";
            }
        }
    }