Exemplo n.º 1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tz888.Model.Sys.SysGroupTab> DataTableToList(DataTable dt)
        {
            List <Tz888.Model.Sys.SysGroupTab> modelList = new List <Tz888.Model.Sys.SysGroupTab>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tz888.Model.Sys.SysGroupTab model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Tz888.Model.Sys.SysGroupTab();
                    if (dt.Rows[n]["SGID"].ToString() != "")
                    {
                        model.SID = int.Parse(dt.Rows[n]["SGID"].ToString());
                    }
                    if (dt.Rows[n]["SRoleID"].ToString() != "")
                    {
                        model.SRoleID = dt.Rows[n]["SRoleID"].ToString();
                    }
                    model.SName = dt.Rows[n]["SName"].ToString();
                    if (dt.Rows[n]["SysCheck"].ToString() != "")
                    {
                        model.SysCheck = int.Parse(dt.Rows[n]["SysCheck"].ToString());
                    }
                    if (dt.Rows[n]["SysDate"].ToString() != "")
                    {
                        model.SysDate = DateTime.Parse(dt.Rows[n]["SysDate"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 2
0
    /// <summary>
    ///添加组用户与角色
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Add_btn_Click(object sender, EventArgs e)
    {
        //实体化组表的实体类

        //判断组名不能够为空

        if (this.nameTxt.Text.ToString().Trim().Length > 0)
        {
            Tz888.Model.Sys.SysGroupTab GroupModel = new Tz888.Model.Sys.SysGroupTab();

            //foreach (Tz888.Model.Common.IndustryModel model in industryModels)
            //{
            //    capitalInfoModel.IndustryBID += model.IndustryBID + ",";
            //}
            //角色的实体类声明
            List <Tz888.Model.Sys.SysRoleTab> RoleModels = new List <Tz888.Model.Sys.SysRoleTab>();
            RoleModels = this.SelectIndustryControl1.IndustryModels;
            foreach (Tz888.Model.Sys.SysRoleTab model in RoleModels)
            {
                GroupModel.SRoleID += model.SRoleID + ",";
            }
            //员工实体类声明

            List <Tz888.Model.Sys.EmployeeInfoTab> EmpModels = new List <Tz888.Model.Sys.EmployeeInfoTab>();
            EmpModels = this.MemberList1.IndustryModels;

            foreach (Tz888.Model.Sys.EmployeeInfoTab model1 in EmpModels)
            {
                GroupModel.EmployeeID += model1.EmployeeID + ",";
            }

            //组名
            GroupModel.SName = this.nameTxt.Text.ToString().Trim();
            //组描述

            GroupModel.SDescribe = this.TxtSRDoc.Value.ToString().Trim();
            //是否通过
            GroupModel.SysCheck = 0;
            //创建日期
            GroupModel.SysDate = Convert.ToDateTime(DateTime.Now);
            //添加数据
            Tz888.SQLServerDAL.Sys.SysGroupTab InsertDAL = new Tz888.SQLServerDAL.Sys.SysGroupTab();
            if (InsertDAL.Add(GroupModel) > 0)
            {
                //  Response.Write("<script>alert('ok')</script>");
                Response.Redirect("viewGroup.aspx");
            }
            else
            {
                Response.Write("<script>alert('no')</script>");
            }
        }
        else
        {
            //  Response.Write("<script>alert('组名不能够为空!');</script>");
            Tz888.Common.MessageBox.Show(this.Page, "组名不能够为空!");
        }
    }
Exemplo n.º 3
0
    /// <summary>
    /// 修改组数据

    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void Modify_btn_Click(object sender, EventArgs e)
    {
        //实体化组表的实体类


        Tz888.Model.Sys.SysGroupTab GroupModel = new Tz888.Model.Sys.SysGroupTab();


        List <Tz888.Model.Sys.SysRoleTab> RoleModels = new List <Tz888.Model.Sys.SysRoleTab>();

        RoleModels = this.SelectIndustryControl1.IndustryModels;
        foreach (Tz888.Model.Sys.SysRoleTab model in RoleModels)
        {
            GroupModel.SRoleID += model.SRoleID + ",";
        }
        //员工实体类声明

        List <Tz888.Model.Sys.EmployeeInfoTab> EmpModels = new List <Tz888.Model.Sys.EmployeeInfoTab>();

        EmpModels = this.MemberList1.IndustryModels;

        foreach (Tz888.Model.Sys.EmployeeInfoTab model1 in EmpModels)
        {
            GroupModel.EmployeeID += model1.EmployeeID + ",";
        }
        //组的ID
        GroupModel.SGID = Convert.ToInt16(this.SGID);
        //组名
        GroupModel.SName = this.nameTxt.Text.ToString().Trim();
        //组描述

        GroupModel.SDescribe = this.TxtSRDoc.Value.ToString().Trim();
        //是否通过
        GroupModel.SysCheck = 1;
        //创建日期
        GroupModel.SysDate = Convert.ToDateTime(DateTime.Now);
        //添加数据
        Tz888.SQLServerDAL.Sys.SysGroupTab InsertDAL = new Tz888.SQLServerDAL.Sys.SysGroupTab();
        bool flag = false;

        try
        {
            InsertDAL.Update(GroupModel);
            flag = true;
        }
        catch
        {
        }
        if (flag)
        {
            Response.Write("<script>alert('修改成功');location.href='viewGroup.aspx';</script>");
        }
        else
        {
            Response.Write("<script>alert('no')</script>");
        }
    }
Exemplo n.º 4
0
 private void DataBinder(int SGID)
 {
     Tz888.Model.Sys.SysGroupTab        GroupModel = new Tz888.Model.Sys.SysGroupTab();
     Tz888.SQLServerDAL.Sys.SysGroupTab MDAL       = new Tz888.SQLServerDAL.Sys.SysGroupTab();
     GroupModel = MDAL.GetModel(SGID);
     if (GroupModel != null)
     {
         this.SelectIndustryControl1.IndustryString = GroupModel.SRoleID;
         //Response.Write(GroupModel.SRoleID);
         this.MemberList1.IndustryString = GroupModel.EmployeeID;
     }
     this.nameTxt.Text   = GroupModel.SName;
     this.TxtSRDoc.Value = GroupModel.SDescribe;
 }
Exemplo n.º 5
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Tz888.Model.Sys.SysGroupTab model)
 {
     dal.Update(model);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(Tz888.Model.Sys.SysGroupTab model)
 {
     return(dal.Add(model));
 }