Beispiel #1
0
        public static bool Insert(Model.RolePowers model)
        {
            string sb = "insert into RolePowers(RType,CID,IFVerify) values (@RType,@CID,@IFVerify);";

            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@RType", SqlDbType.VarChar, 10),
                new SqlParameter("@CID", SqlDbType.VarChar, 10),
                new SqlParameter("@IFVerify", SqlDbType.Bit, 1)
            };

            para[0].Value = model.RType;
            para[1].Value = model.CID;
            para[2].Value = model.IFVerify;

            return(DbHelperSQL.ExecuteSql(sb, para) > 0);
        }
Beispiel #2
0
 protected List<Model.RolePowers> rolePowersList()
 {
     List<Model.RolePowers> list = new List<Model.RolePowers>();
     string roleList = Request.Form["chkAuth"];
     if (!string.IsNullOrEmpty(roleList))
     {
         string[] array = roleList.Split(',');
         foreach (string str in array)
         {
             Model.RolePowers obj = new Model.RolePowers();
             obj.CID = menu.CID;
             obj.IFVerify = true;
             obj.RType = str;
             list.Add(obj);
         }
     }
     return list;
 }
Beispiel #3
0
 private static Model.RolePowers TranEntity(DataRow dr)
 {
     Model.RolePowers model = new Model.RolePowers();
     if (dr["RType"].ToString() != "")
     {
         model.RType = dr["RType"].ToString();
     }
     if (dr["CID"].ToString() != "")
     {
         model.CID     = dr["CID"].ToString();
         model.Content = DAL.Contents.List.Single(emp => emp.CID == model.CID);
     }
     if (dr["IFVerify"].ToString() != "")
     {
         model.IFVerify = bool.Parse(dr["IFVerify"].ToString());
     }
     if (dr["RID"].ToString() != "")
     {
         model.RID = int.Parse(dr["RID"].ToString());
     }
     return(model);
 }
Beispiel #4
0
        public static bool Update(Model.RolePowers model)
        {
            StringBuilder sb = new StringBuilder("update RolePowers set ");

            sb.Append("IFVerify=@IFVerify,");
            sb.Append("RType=@RType,");
            sb.Append("CID=@CID");
            sb.Append(" where ");
            sb.Append("RID=@RID");
            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@RType", SqlDbType.VarChar, 20),
                new SqlParameter("@CID", SqlDbType.VarChar, 20),
                new SqlParameter("@IFVerify", SqlDbType.Bit, 1),
                new SqlParameter("@RID", SqlDbType.Int, 4)
            };

            para[0].Value = model.RType;
            para[1].Value = model.CID;
            para[2].Value = model.IFVerify;
            para[3].Value = model.RID;

            return(DbHelperSQL.ExecuteSql(sb.ToString(), para) > 0);
        }
Beispiel #5
0
 public static bool Update(Model.RolePowers model)
 {
     return(DAL.RolePowers.Update(model));
 }
Beispiel #6
0
 public static bool Insert(Model.RolePowers model)
 {
     return(DAL.RolePowers.Insert(model));
 }