private PagedDataSource pds()
        {
            string whereSql = "";

            if (classId > 0)
            {
                whereSql = " and sch.ID=" + SchID;
            }
            string  sql = string.Format(@"SELECT 
st.Sid,st.Snumber,st.Gid,st.Uid,st.Sbirthday,st.Sname,st.MechID,st.IsDeleted,
g.Gdescription,g.GgradeName,g.Gname,
schg.Name as 'GradeName',sch.Name as 'SchoolName',schg.SchoolID
--,
--cat.Cphone,cat.Cphone2,cat.Cphone3,cat.Cphone4
FROM Daiv_OA..OA_Student(NOLOCK) st 
JOIN Daiv_OA..OA_Grade(NOLOCK) g ON g.Gid = st.Gid
left join OA_SchoolGrade schg on g.GgradeID = schg.ID
left join OA_School sch on sch.ID = schg.SchoolID
--LEFT JOIN Daiv_OA..OA_Contact(NOLOCK) cat ON cat.Sid = st.Sid
WHERE st.IsDeleted = 0 AND g.IsDeleted = 0  AND st.MechID ={0}{1}
order by sch.Name,schg.Name,g.Gname,st.Sname
", UserId, whereSql);
            DataSet ds  = new Daiv_OA.BLL.GradeBLL().Getall(sql);
            //this.user_repeater.DataBind();
            //this.user_repeater.DataSource = new Daiv_OA.BLL.UserBLL().Getall(sql);
            //this.user_repeater.DataBind();

            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = ds.Tables[0].DefaultView;
            pds.AllowPaging      = true; //允许分页
            pds.PageSize         = 50;   //单页显示项数
            pds.CurrentPageIndex = Convert.ToInt32(Request.QueryString["page"]);
            return(pds);
        }
Exemple #2
0
        //添加
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            Entity.GradeEntity gradeEntity = new Entity.GradeEntity();
            gradeEntity.Gname      = this.Gname.Text;
            gradeEntity.GgradeName = "";
            gradeEntity.GgradeID   = Convert.ToInt32(Request["schGradeGid"]);
            gradeEntity.Mphone     = this.Mphone.Text;
            try
            {
                gradeEntity.Gsnumber = int.Parse(this.Gsnumber.Text);
            }
            catch (Exception) { }
            if (this.Gdescription.Text != "")
            {
                gradeEntity.Gdescription = this.Gdescription.Text;
            }
            gradeEntity.MechID = UserId;
            int i = new Daiv_OA.BLL.GradeBLL().Add(gradeEntity);

            if (i > 0)
            {
                logHelper.logInfo("添加班级成功!");
                FinalMessage("操作成功", "Grade_List.aspx?gid=" + gradeId, 0);
            }
            else if (i == 0)
            {
                FinalMessage("相同的班级已经存在", "", 1);
            }
            else if (i == -1)
            {
                FinalMessage("相同的年级已经存在", "", 1);
            }
        }
Exemple #3
0
 //更新
 protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
 {
     Entity.GradeEntity model = new Entity.GradeEntity();
     model = new Daiv_OA.BLL.GradeBLL().GetEntity(Str2Int(q("id"), 0));
     model.Gdescription = this.Gdescription.Text;
     model.Mphone       = this.Mphone.Text;
     model.GgradeName   = "";
     model.Gname        = this.Gname.Text;
     try
     {
         model.GgradeID = Convert.ToInt32(Request["schGradeGid"]);
         model.Gsnumber = Convert.ToInt32(this.Gsnumber.Text);
     }
     catch (Exception)
     {
         logHelper.logInfo("班级人数转换失败!操作人:" + UserId);
     }
     new Daiv_OA.BLL.GradeBLL().Update(model);
     logHelper.logInfo("修改班级成功!操作人:" + UserId);
     FinalMessage("操作成功", "Grade_List.aspx?gid=" + gradeId, 0);
 }
Exemple #4
0
        //数据绑定
        void Bind()
        {
            int gid = Str2Int(q("id"), 0);

            Daiv_OA.Entity.GradeEntity model = new Daiv_OA.Entity.GradeEntity();
            model                  = new Daiv_OA.BLL.GradeBLL().GetEntity(gid);
            this.Gname.Text        = model.Gname;
            this.Gsnumber.Text     = model.Gsnumber.ToString();
            this.Gdescription.Text = model.Gdescription;
            //this.GgradeName.Text = model.GgradeName;
            this.Mphone.Text = model.Mphone;


            //设置年级ID
            SchGradeId = model.GgradeID;
            //设置学校ID
            Entity.SchoolGradeEntity scEntity = new BLL.SchoolGradeBLL().GetEntity(SchGradeId);
            if (scEntity != null)
            {
                SchID = scEntity.SchoolID;
            }
        }
Exemple #5
0
        private PagedDataSource pds()
        {
            string whereSql = "";

            if (gradeId > 0)
            {
                whereSql = " and cg.GgradeID=" + gradeId;
            }

            DataSet ds = new Daiv_OA.BLL.GradeBLL().GetList(0, " MechID=" + UserId + whereSql, " Gname asc");
            //this.user_repeater.DataBind();
            //this.user_repeater.DataSource = new Daiv_OA.BLL.UserBLL().Getall(sql);
            //this.user_repeater.DataBind();

            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = ds.Tables[0].DefaultView;
            pds.AllowPaging      = true; //允许分页
            pds.PageSize         = 8;    //单页显示项数
            pds.CurrentPageIndex = Convert.ToInt32(Request.QueryString["page"]);
            return(pds);
        }
Exemple #6
0
        private PagedDataSource pds()
        {
            string  sql = string.Format(@"
select om.*,g.Gname as 'GClassName',schg.Name as 'GradeName',sch.Name as 'SchoolName',schg.SchoolID
from OA_Mechanical om
JOIN Daiv_OA..OA_Grade(NOLOCK) g ON g.Gid = om.Gid
left join OA_SchoolGrade schg on g.GgradeID = schg.ID
left join OA_School sch on sch.ID = schg.SchoolID
where om.IsDeleted = 0
", UserId);
            DataSet ds  = new Daiv_OA.BLL.GradeBLL().Getall(sql);
            //this.user_repeater.DataBind();
            //this.user_repeater.DataSource = new Daiv_OA.BLL.UserBLL().Getall(sql);
            //this.user_repeater.DataBind();

            PagedDataSource pds = new PagedDataSource();

            pds.DataSource       = ds.Tables[0].DefaultView;
            pds.AllowPaging      = true; //允许分页
            pds.PageSize         = 8;    //单页显示项数
            pds.CurrentPageIndex = Convert.ToInt32(Request.QueryString["page"]);
            return(pds);
        }
Exemple #7
0
        //数据绑定
        void Bind()
        {
            int uid = Str2Int(q("id"), 0);

            department();
            roless();

            Daiv_OA.Entity.UserEntity model = new Daiv_OA.Entity.UserEntity();
            model = new Daiv_OA.BLL.UserBLL().GetEntity(uid);
            this.txtUname.Text     = model.Uname;
            this.txtUname.ReadOnly = true;
            // this.txtPosition.Text = model.Position; //职位
            this.txtIpaddress.Text = model.Uipaddress;
            //this.UClassID.Text = model.UClassID.ToString();
            this.ULongName.Text = model.ULongName;
            //this.UClassName.Text = model.UClassName ;
            this.Mphone.Text = model.Mphone;
            string user_setting = "";

            string[,] menu = null;
            if (pidtxt.Text != "")
            {
                Entity.PowerEntity powerEntity = new BLL.PowerBLL().GetEntity(Convert.ToInt32(pidtxt.Text.Trim()));
                user_setting = powerEntity.Setting;
                int pid = Convert.ToInt32(pidtxt.Text);

                if (depid.Text != "")
                {
                    DropDownList1.SelectedValue = depid.Text.ToString();
                }
                else
                {
                    DropDownList1.SelectedValue = model.Did.ToString();
                }
                DropDownList2.SelectedValue = pid.ToString();
                if (pid == 1)
                {
                    menu = powerMenu1();
                }
                if (pid == 2)
                {
                    menu = powerMenu2();
                }
                else if (pid == 3)
                {
                    menu = powerMenu3();
                }
                else if (pid == 4)
                {
                    menu = powerMenu4();
                }
            }
            else
            {
                DropDownList1.SelectedValue = model.Did.ToString();

                DropDownList2.SelectedValue = model.Pid.ToString();
                user_setting = model.Setting;
                if (model.Pid == 1)
                {
                    menu = powerMenu1();
                }
                if (model.Pid == 2)
                {
                    menu = powerMenu2();
                }
                else if (model.Pid == 3)
                {
                    menu = powerMenu3();
                }
                else if (model.Pid == 4)
                {
                    menu = powerMenu4();
                }
            }

            //绑定班级
            Daiv_OA.BLL.GradeBLL dp = new Daiv_OA.BLL.GradeBLL();
            DataSet ds = dp.GetList("");

            for (int j = 0; j < ds.Tables[0].Rows.Count; j++)
            {
                ListItem listItem = new ListItem();
                listItem.Text  = ds.Tables[0].Rows[j]["Gname"].ToString();
                listItem.Value = ds.Tables[0].Rows[j]["Gid"].ToString();
                this.ddlGid.Items.Add(listItem);
            }
            this.ddlGid.SelectedValue = model.UClassID.ToString();
            ds.Clear();

            StringBuilder sb = new StringBuilder();

            sb.Append("<table cellspacing=\"0\" width=\"100%\" cellpadding=\"0\" align=\"center\">");
            for (int i = 0; i < menu.GetLength(0); i++)
            {
                sb.Append("<tr><td width=\"260\" align=\"right\"><strong>" + menu[i, 0] + "</strong></td>");
                sb.Append("<td width=\"*\">");
                for (int j = 1; j < menu.GetLength(1); j++)
                {
                    if (menu[i, j] == null)
                    {
                        break;
                    }
                    string[] _split = menu[i, j].Split('|');
                    sb.Append("<span style='float:left;height:30px;margin-left:10px;padding-top:5px;' scope='col'><input id=\"user_setting_" + i + "_" + j + "\" type=checkbox class='checkbox' name=\"user_setting\" value=\"");
                    string tPower = _split[1];
                    sb.Append(tPower + "\"");
                    if (_split.Length > 2 && _split[2] == "1")
                    {
                        sb.Append(" onclick='if(!this.checked){this.checked=true;}else{this.checked=false;}'");
                    }
                    if (user_setting.Contains("," + tPower + ","))
                    {
                        sb.Append(" checked");
                    }
                    sb.Append("><label for=\"user_setting_" + i + "_" + j + "\">" + _split[0] + "</label>");
                    sb.Append("</span>\r\n");
                }
                sb.Append("</td></tr>");
            }
            sb.Append("</td></tr>");
            sb.Append("</table>");
            this.ltMasterSetting.Text = sb.ToString();
        }