Example #1
0
        public bool GetUserPower(string value, string authKey)
        {
            string name = GetName(authKey);

            BLL.Data_Centre.Link bll = new BLL.Data_Centre.Link();
            bll.ChangeDBShop();
            string    sql = string.Format(@"DECLARE @role VARCHAR(200)
                                        SELECT  @role = role
                                        FROM    yxs_administrators
                                        WHERE   name = '{0}'
                                        SELECT  operatecode
                                        FROM    dbo.yxs_roles_permissions
                                        WHERE   id IN ( SELECT  *
                                                        FROM    dbo.f_split(@role, ',') )", name);
            DataTable dt  = bll.ExecuteTable(sql);

            foreach (DataRow dr in dt.Rows)
            {
                string v = dr["operatecode"].ToString();
                if (value.Equals(v))
                {
                    return(true);
                }
            }
            return(false);
        }
Example #2
0
 public DataSet GetCompleteLink(string t_id, int iden, string authKey)
 {
     if (islogin(authKey))
     {
         string sql = string.Format("SELECT * FROM [Link] where t_id='{0}' and iden={1}", t_id, iden);
         BLL.Data_Centre.Link bll = new BLL.Data_Centre.Link();
         var dr = bll.ExecuteTable(sql).Rows[0];
         bll.ChangeDBShop();
         sql = string.Format("SELECT * FROM dbo._ViewDrugsBaseAndGoods WHERE Product_ID={0} ", dr["id"]);
         return(bll.ExecuteDataSet(sql));
     }
     return(null);
 }