Пример #1
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tunnel.Model.Tunnel_jiaose> DataTableToList(DataTable dt)
        {
            List <Tunnel.Model.Tunnel_jiaose> modelList = new List <Tunnel.Model.Tunnel_jiaose>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tunnel.Model.Tunnel_jiaose model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model      = new Tunnel.Model.Tunnel_jiaose();
                    model.j_id = Convert.ToInt64(dt.Rows[n]["j_id"].ToString());
                    if (dt.Rows[n]["j_name"].ToString() != "")
                    {
                        model.j_name = dt.Rows[n]["j_name"].ToString();
                    }
                    if (dt.Rows[n]["j_depict"].ToString() != "")
                    {
                        model.j_depict = dt.Rows[n]["j_depict"].ToString();
                    }
                    model.j_flag = dt.Rows[n]["j_flag"].ToString();
                    if (dt.Rows[n]["j_zdyjs"].ToString() != "")
                    {
                        model.j_zdyjs = int.Parse(dt.Rows[n]["j_zdyjs"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #2
0
        public List <Tunnel.Model.Tunnel_jiaose> GetList(PageBase pb, ref int count)
        {
            DataTable dt = dal.GetList(pb, ref count).Tables[0];
            List <Tunnel.Model.Tunnel_jiaose> modelList = new List <Tunnel.Model.Tunnel_jiaose>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0 && pb.DoCount == 0)
            {
                Tunnel.Model.Tunnel_jiaose model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model      = new Tunnel.Model.Tunnel_jiaose();
                    model.j_id = Convert.ToInt64(dt.Rows[n]["j_id"].ToString());
                    if (dt.Rows[n]["j_name"].ToString() != "")
                    {
                        model.j_name = dt.Rows[n]["j_name"].ToString();
                    }
                    if (dt.Rows[n]["j_depict"].ToString() != "")
                    {
                        model.j_depict = dt.Rows[n]["j_depict"].ToString();
                    }
                    model.j_flag = dt.Rows[n]["j_flag"].ToString();
                    if (dt.Rows[n]["j_zdyjs"].ToString() != "")
                    {
                        model.j_zdyjs = int.Parse(dt.Rows[n]["j_zdyjs"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["updid"]))
         {
             jid          = Request.QueryString["updid"].ToString();
             tjj          = tj.GetModel(Convert.ToInt64(jid));
             txtName.Text = tjj.j_name;
             txtfl.Text   = tjj.j_flag;
         }
         else
         {
             Tunnel.Common.Message.Show("非法访问", "tunnel_jueseguanli.aspx");
         }
     }
 }
Пример #4
0
 /// <summary>
 /// 得到 类型ID 和 ID
 /// </summary>
 public void getIdtypeId(ref int tmpId, ref int typeId)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["uid"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["uid"].ToString());
         tempName = "用户管理";
         Tunnel.BLL.Tunnel_menber   menberBLL   = new Tunnel.BLL.Tunnel_menber();
         Tunnel.Model.Tunnel_menber menberModel = menberBLL.GetModel(tmpId);
         tempName_TypeName = menberModel.m_name;
         typeId            = 1;
         if (!string.IsNullOrEmpty(Request.QueryString["uid"]))
         {
             GetUserAllPermission(int.Parse(Request.QueryString["uid"]));
         }
     }
     if (!string.IsNullOrEmpty(Request.QueryString["jid"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["jid"].ToString());
         tempName = "角色管理";
         Tunnel.BLL.Tunnel_jiaose   jiaoseBLL   = new Tunnel.BLL.Tunnel_jiaose();
         Tunnel.Model.Tunnel_jiaose jiaoseModel = jiaoseBLL.GetModel(tmpId);
         tempName_TypeName   = jiaoseModel.j_name;
         this.tmpSet.Visible = false;
         typeId = 2;
     }
     if (!string.IsNullOrEmpty(Request.QueryString["did"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["did"].ToString());
         tempName = "职位管理";
         Tunnel.BLL.Tunnel_duty   dutyBLL   = new Tunnel.BLL.Tunnel_duty();
         Tunnel.Model.Tunnel_duty dutyModel = dutyBLL.GetModel(tmpId);
         tempName_TypeName   = dutyModel.d_name;
         this.tmpSet.Visible = false;
         typeId = 3;
     }
     if (!string.IsNullOrEmpty(Request.QueryString["bid"]))
     {
         tmpId = Convert.ToInt32(Request.QueryString["bid"].ToString());
         Tunnel.BLL.Tunnel_bum   bumBLL    = new Tunnel.BLL.Tunnel_bum();
         Tunnel.Model.Tunnel_bum bumModels = bumBLL.GetModel(tmpId);
         tempName_TypeName   = bumModels.b_name;
         tempName            = "部门管理";
         this.tmpSet.Visible = false;
         typeId = 4;
     }
 }
Пример #5
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(Tunnel.Model.Tunnel_jiaose model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@j_id",     SqlDbType.BigInt,     8),
                new SqlParameter("@j_name",   SqlDbType.VarChar,  100),
                new SqlParameter("@j_depict", SqlDbType.VarChar, 1000),
                new SqlParameter("@j_flag",   SqlDbType.VarChar, 2000),
                new SqlParameter("@j_zdyjs",  SqlDbType.Int, 4)
            };
            parameters[0].Value = model.j_id;
            parameters[1].Value = model.j_name;
            parameters[2].Value = model.j_depict;
            parameters[3].Value = model.j_flag;
            parameters[4].Value = model.j_zdyjs;

            DbHelperSQL.RunProcedure("Tunnel_jiaose_Update", parameters, out rowsAffected);
        }
Пример #6
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(Tunnel.Model.Tunnel_jiaose model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@j_id",     SqlDbType.Int,        8),
                new SqlParameter("@j_name",   SqlDbType.VarChar,  100),
                new SqlParameter("@j_depict", SqlDbType.VarChar, 1000),
                new SqlParameter("@j_flag",   SqlDbType.VarChar, 2000),
                new SqlParameter("@j_zdyjs",  SqlDbType.Int, 4)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.j_name;
            parameters[2].Value     = model.j_depict;
            parameters[3].Value     = model.j_flag;
            parameters[4].Value     = model.j_zdyjs;

            DbHelperSQL.RunProcedure("Tunnel_jiaose_ADD", parameters, out rowsAffected);
            return((int)parameters[0].Value);
        }
Пример #7
0
        /// <summary>
        /// 用户角色名称
        /// </summary>
        public string JiaoSe(int userId)
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(Convert.ToInt64(userId.ToString()));
            string jiaose = "无角色";

            if (userId == 1)
            {
                jiaose = "系统管理员";
            }
            if (tmm.m_jiao != 0)
            {
                Tunnel_jiaose tj = new Tunnel_jiaose();
                Tunnel.Model.Tunnel_jiaose tjj = new Tunnel.Model.Tunnel_jiaose();
                tjj = tj.GetModel(Convert.ToInt64(tmm.m_jiao.ToString()));
                if (tjj != null)
                {
                    jiaose = tjj.j_name;
                }
            }
            return(jiaose);
        }
Пример #8
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Tunnel.Model.Tunnel_jiaose GetModel(long j_id)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@j_id", SqlDbType.BigInt)
            };
            parameters[0].Value = j_id;

            Tunnel.Model.Tunnel_jiaose model = new Tunnel.Model.Tunnel_jiaose();
            DataSet ds = DbHelperSQL.RunProcedure("Tunnel_jiaose_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["j_id"].ToString() != "")
                {
                    model.j_id = long.Parse(ds.Tables[0].Rows[0]["j_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["j_name"].ToString() != "")
                {
                    model.j_name = ds.Tables[0].Rows[0]["j_name"].ToString();
                }
                if (ds.Tables[0].Rows[0]["j_depict"].ToString() != "")
                {
                    model.j_depict = ds.Tables[0].Rows[0]["j_depict"].ToString();
                }
                model.j_flag = ds.Tables[0].Rows[0]["j_flag"].ToString();
                if (ds.Tables[0].Rows[0]["j_zdyjs"].ToString() != "")
                {
                    model.j_zdyjs = int.Parse(ds.Tables[0].Rows[0]["j_zdyjs"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Пример #9
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Tunnel.Model.Tunnel_jiaose model)
 {
     dal.Update(model);
 }
Пример #10
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Tunnel.Model.Tunnel_jiaose model)
 {
     return(dal.Add(model));
 }