コード例 #1
0
        public List <Models.DbModels.app> GetList(XXF.Db.DbConn PubConn, int pno, int pagesize, string keywords, out int totalcount)
        {
            totalcount = 0;
            List <Models.DbModels.app> listapp = new List <DbModels.app>();
            string sql = string.Format(basesql, " ROW_NUMBER() over (order by appid) as rownum, appid,appname,appsecret,app.apptype,appgrade.appgradeno,appgrade.appgradename,appdesc,freeze ");;

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            string con = "";

            if (!string.IsNullOrEmpty(keywords))
            {
                con = " and app.appid like '%' + @keywords + '%' or app.appname like '%' + @keywords + '%' or appname like '%' + @keywords + '%' ";
                para.Add("@keywords", keywords);
                sql = sql + con;
            }
            string  querysql = string.Concat("select A.* from (", sql, ") A ", " where A.rownum between ", (pno - 1) * pagesize + 1, " and ", pno * pagesize);
            DataSet ds       = new DataSet();

            PubConn.SqlToDataSet(ds, querysql, para.ToParameters());
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                listapp.Add(FillModel(dr));
            }
            totalcount = (int)PubConn.ExecuteScalar(string.Format(basesql, " count(*) ") + con, para.ToParameters());

            return(listapp);
        }
コード例 #2
0
ファイル: AccountDal.cs プロジェクト: buweixiaomi/DydCert
        /// <summary>根据userid得到管理员工信息</summary>
        public DbModels.manage getManage(XXF.Db.DbConn PubConn, string userid)
        {
            string  sql = "select ygbh,ygmc,ygmm,ygzt,sfsc from tb_userinfo where ygbh=@userid";
            DataSet ds  = new DataSet();

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@userid", userid);
            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            if (ds.Tables[0].Rows.Count != 1)
            {
                return(null);
            }
            DbModels.manage model = new DbModels.manage();
            model.userid   = ds.Tables[0].Rows[0]["ygbh"].ToString();
            model.id       = model.userid;
            model.username = ds.Tables[0].Rows[0]["ygmc"].ToString();
            model.pwd      = privateToDeDES(ds.Tables[0].Rows[0]["ygmm"].ToString());
            model.freeze   = Convert.ToInt32(ds.Tables[0].Rows[0]["sfsc"]);
            if (model.freeze == 0)
            {
                model.freeze = 1;
            }
            else
            {
                model.freeze = 0;
            }
            return(model);
        }
コード例 #3
0
        public int AddApp(XXF.Db.DbConn PubConn, Models.DbModels.app model)
        {
            if (string.IsNullOrEmpty(model.appid))
            {
                model.appid = XXF.Db.LibString.MakeRandomNumber(16).ToLower();
            }
            if (ExitAppid(PubConn, model.appid))
            {
                return(-2);
            }
            if (string.IsNullOrEmpty(model.appsecret))
            {
                model.appsecret = Guid.NewGuid().ToString().Replace("-", "");
            }

            string sql = "insert into app(appid,appname,apptype,appgradeno,appsecret,appdesc,freeze) values(@appid,@appname,@apptype,@appgradeno,@appsecret,@appdesc,@freeze)";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@appid", model.appid);
            para.Add("@appsecret", model.appsecret);
            para.Add("@appname", model.appname);
            para.Add("@apptype", model.apptype);
            para.Add("@appgradeno", model.appgradeno);
            para.Add("@freeze", model.freeze);
            para.Add("@appdesc", model.appdesc ?? "");

            int r = PubConn.ExecuteSql(sql, para.ToParameters());

            return(r);
        }
コード例 #4
0
ファイル: AccountDal.cs プロジェクト: buweixiaomi/DydCert
 /// <summary>根据userid得到管理员工信息</summary>
 public DbModels.manage getManage(XXF.Db.DbConn PubConn, string userid)
 {
     string sql = "select ygbh,ygmc,ygmm,ygzt,sfsc from tb_userinfo where ygbh=@userid";
     DataSet ds = new DataSet();
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@userid", userid);
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     if (ds.Tables[0].Rows.Count != 1)
         return null;
     DbModels.manage model = new DbModels.manage();
     model.userid = ds.Tables[0].Rows[0]["ygbh"].ToString();
     model.id = model.userid;
     model.username = ds.Tables[0].Rows[0]["ygmc"].ToString();
     model.pwd = privateToDeDES(ds.Tables[0].Rows[0]["ygmm"].ToString());
     model.freeze = Convert.ToInt32(ds.Tables[0].Rows[0]["sfsc"]);
     if (model.freeze == 0)
     {
         model.freeze = 1;
     }
     else
     {
         model.freeze = 0;
     }
     return model;
 }
コード例 #5
0
ファイル: AppDal.cs プロジェクト: buweixiaomi/DydCert
        public int AddApp(XXF.Db.DbConn PubConn, Models.DbModels.app model)
        {
            if (string.IsNullOrEmpty(model.appid))
            {
                model.appid = XXF.Db.LibString.MakeRandomNumber(16).ToLower();
            }
            if (ExitAppid(PubConn, model.appid))
            {
                return -2;
            }
            if (string.IsNullOrEmpty(model.appsecret))
            {
                model.appsecret = Guid.NewGuid().ToString().Replace("-", "");
            }

            string sql = "insert into app(appid,appname,apptype,appgradeno,appsecret,appdesc,freeze) values(@appid,@appname,@apptype,@appgradeno,@appsecret,@appdesc,@freeze)";
            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@appid", model.appid);
            para.Add("@appsecret", model.appsecret);
            para.Add("@appname", model.appname);
            para.Add("@apptype", model.apptype);
            para.Add("@appgradeno", model.appgradeno);
            para.Add("@freeze", model.freeze);
            para.Add("@appdesc", model.appdesc ?? "");

            int r = PubConn.ExecuteSql(sql, para.ToParameters());
            return r;
        }
コード例 #6
0
ファイル: AppDal.cs プロジェクト: buweixiaomi/DydCert
 public int DeletApp(XXF.Db.DbConn PubConn, string appid)
 {
     string sql = "delete from app where appid=@appid";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@appid", appid);
     int r = PubConn.ExecuteSql(sql, para.ToParameters());
     return r;
 }
コード例 #7
0
ファイル: AppDal.cs プロジェクト: buweixiaomi/DydCert
 public bool ExitAppid(XXF.Db.DbConn PubConn, string appid)
 {
     string sql = "select count(*) from app where appid=@appid";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@appid", appid);
     int r = (int)PubConn.ExecuteScalar(sql, para.ToParameters());
     return r == 1;
 }
コード例 #8
0
        public int DeletApp(XXF.Db.DbConn PubConn, string appid)
        {
            string sql = "delete from app where appid=@appid";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@appid", appid);
            int r = PubConn.ExecuteSql(sql, para.ToParameters());

            return(r);
        }
コード例 #9
0
        public bool ExitAppid(XXF.Db.DbConn PubConn, string appid)
        {
            string sql = "select count(*) from app where appid=@appid";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@appid", appid);
            int r = (int)PubConn.ExecuteScalar(sql, para.ToParameters());

            return(r == 1);
        }
コード例 #10
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
 public int DeleteGrade(XXF.Db.DbConn PubConn, int apptype, int appgradeno)
 {
     string countsql = "  select COUNT(*) from api where apptype=" + apptype + " and appgradeno=" + appgradeno + "";
     int c = (int)PubConn.ExecuteScalar(countsql, null);
     if (c != 0)
         return -2;
     string sql = "delete from appgrade where  apptype=@apptype and appgradeno=@appgradeno";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", apptype);
     para.Add("@appgradeno", appgradeno);
     int r = PubConn.ExecuteSql(sql, para.ToParameters());
     return r;
 }
コード例 #11
0
ファイル: AppcategoryDal.cs プロジェクト: buweixiaomi/DydCert
 public int DeleteCategory(XXF.Db.DbConn PubConn, int apptype, int categoryid)
 {
     string countsql = "  select COUNT(*) from gradepermission where apptype=" + apptype + " and categoryid=" + categoryid + "";
     int c = (int)PubConn.ExecuteScalar(countsql, null);
     if (c != 0)
         return -2;
     string sql = "delete from appcategory where  apptype=@apptype and categoryid=@categoryid";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", apptype);
     para.Add("@categoryid", categoryid);
     int r = PubConn.ExecuteSql(sql, para.ToParameters());
     return r;
 }
コード例 #12
0
        public int UpdateCategory(XXF.Db.DbConn PubConn, Models.DbModels.appcategory model)
        {
            model.categorydesc = model.categorydesc ?? "";
            string sql = "update  appcategory set categorytitle=@categorytitle,categorydesc=@categorydesc where  apptype=@apptype and categoryid=@categoryid";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", model.apptype);
            para.Add("@categoryid", model.categoryid);
            para.Add("@categorytitle", model.categorytitle);
            para.Add("@categorydesc", model.categorydesc);
            int r = PubConn.ExecuteSql(sql, para.ToParameters());

            return(r);
        }
コード例 #13
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
        public int UpdateGrade(XXF.Db.DbConn PubConn, Models.DbModels.appgrade model)
        {
            model.appgradedesc = model.appgradedesc ?? "";
            string sql = "update  appgrade set appgradename=@appgradename,appgradedesc=@appgradedesc where  apptype=@apptype and appgradeno=@appgradeno";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", model.apptype);
            para.Add("@appgradeno", model.appgradeno);
            para.Add("@appgradename", model.appgradename);
            para.Add("@appgradedesc", model.appgradedesc);
            int r = PubConn.ExecuteSql(sql, para.ToParameters());

            return(r);
        }
コード例 #14
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
 public int AddGrade(XXF.Db.DbConn PubConn, Models.DbModels.appgrade model)
 {
     model.appgradedesc = model.appgradedesc ?? "";
     string getcatid = "select isnull(max(appgradeno),0)+1 from appgrade where apptype=" + model.apptype;
     model.appgradeno = Convert.ToInt32(PubConn.ExecuteScalar(getcatid, null));
     string addsql = "insert into appgrade(apptype,appgradeno,appgradename,appgradedesc) values(@apptype,@appgradeno,@appgradename,@appgradedesc)";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", model.apptype);
     para.Add("@appgradeno", model.appgradeno);
     para.Add("@appgradename", model.appgradename);
     para.Add("@appgradedesc", model.appgradedesc);
     int r = PubConn.ExecuteSql(addsql, para.ToParameters());
     return r;
 }
コード例 #15
0
ファイル: AppcategoryDal.cs プロジェクト: buweixiaomi/DydCert
 public int Addcategory(XXF.Db.DbConn PubConn, Models.DbModels.appcategory model)
 {
     model.categorydesc = model.categorydesc ?? "";
     string getcatid = "select isnull(max(categoryid),0)+1 from appcategory where apptype=" + model.apptype;
     model.categoryid = Convert.ToInt32(PubConn.ExecuteScalar(getcatid, null));
     string addsql = "insert into appcategory(apptype,categoryid,categorytitle,categorydesc) values(@apptype,@categoryid,@categorytitle,@categorydesc)";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", model.apptype);
     para.Add("@categoryid", model.categoryid);
     para.Add("@categorytitle", model.categorytitle);
     para.Add("@categorydesc", model.categorydesc);
     int r = PubConn.ExecuteSql(addsql, para.ToParameters());
     return r;
 }
コード例 #16
0
        //get
        public Models.DbModels.app GetAppInfo(XXF.Db.DbConn PubConn, string appid)
        {
            string sql = string.Format(basesql, "  appid,appname,appsecret,app.apptype,appgrade.appgradeno,appgrade.appgradename,appdesc,freeze ");

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@appid", appid);
            sql += " and appid=@appid";
            DataSet ds = new DataSet();

            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            if (ds.Tables[0].Rows.Count == 0)
            {
                return(null);
            }
            return(FillModel(ds.Tables[0].Rows[0]));
        }
コード例 #17
0
        public int Addcategory(XXF.Db.DbConn PubConn, Models.DbModels.appcategory model)
        {
            model.categorydesc = model.categorydesc ?? "";
            string getcatid = "select isnull(max(categoryid),0)+1 from appcategory where apptype=" + model.apptype;

            model.categoryid = Convert.ToInt32(PubConn.ExecuteScalar(getcatid, null));
            string addsql = "insert into appcategory(apptype,categoryid,categorytitle,categorydesc) values(@apptype,@categoryid,@categorytitle,@categorydesc)";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", model.apptype);
            para.Add("@categoryid", model.categoryid);
            para.Add("@categorytitle", model.categorytitle);
            para.Add("@categorydesc", model.categorydesc);
            int r = PubConn.ExecuteSql(addsql, para.ToParameters());

            return(r);
        }
コード例 #18
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
        public int AddGrade(XXF.Db.DbConn PubConn, Models.DbModels.appgrade model)
        {
            model.appgradedesc = model.appgradedesc ?? "";
            string getcatid = "select isnull(max(appgradeno),0)+1 from appgrade where apptype=" + model.apptype;

            model.appgradeno = Convert.ToInt32(PubConn.ExecuteScalar(getcatid, null));
            string addsql = "insert into appgrade(apptype,appgradeno,appgradename,appgradedesc) values(@apptype,@appgradeno,@appgradename,@appgradedesc)";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", model.apptype);
            para.Add("@appgradeno", model.appgradeno);
            para.Add("@appgradename", model.appgradename);
            para.Add("@appgradedesc", model.appgradedesc);
            int r = PubConn.ExecuteSql(addsql, para.ToParameters());

            return(r);
        }
コード例 #19
0
        public int UpdateApp(XXF.Db.DbConn PubConn, Models.DbModels.app model)
        {
            string sql = "update app   set appname=@appname,appsecret=@appsecret,appdesc=@appdesc ,freeze=@freeze ,apptype = @apptype,appgradeno =@appgradeno where appid=@appid";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@appid", model.appid);
            para.Add("@appsecret", model.appsecret);
            para.Add("@appname", model.appname);
            para.Add("@apptype", model.apptype);
            para.Add("@appgradeno", model.appgradeno);
            para.Add("@freeze", model.freeze);
            para.Add("@appdesc", model.appdesc ?? "");

            int r = PubConn.ExecuteSql(sql, para.ToParameters());

            return(r);
        }
コード例 #20
0
ファイル: AccountDal.cs プロジェクト: buweixiaomi/DydCert
 /// <summary></summary>
 public DbModels.manage getUser(XXF.Db.DbConn PubConn, string userid)
 {
     string sql = "select f_id, f_yhzh,f_yhxm,f_dlmm,f_sfdj from tb_customer where f_yhzh=@userid";
     DataSet ds = new DataSet();
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@userid", userid);
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     if (ds.Tables[0].Rows.Count != 1)
         return null;
     DbModels.manage model = new DbModels.manage();
     model.userid = ds.Tables[0].Rows[0]["f_yhzh"].ToString();
     model.id = ds.Tables[0].Rows[0]["f_id"].ToString();
     model.username = ds.Tables[0].Rows[0]["f_yhxm"].ToString();
     model.pwd = privateToDeDES(ds.Tables[0].Rows[0]["f_dlmm"].ToString());
     model.freeze = Convert.ToInt32(ds.Tables[0].Rows[0]["f_sfdj"]);
     return model;
 }
コード例 #21
0
ファイル: AccountDal.cs プロジェクト: buweixiaomi/DydCert
 /// <summary>根据userid得到管理员工信息</summary>
 public DbModels.manage getShop(XXF.Db.DbConn PubConn, string userid)
 {
     string sql = "SELECT  f_shzh,f_shsj,f_shmc,f_dlmm,f_sfdj FROM [tb_shop] where f_shzh=@userid or f_shsj=@userid";
     DataSet ds = new DataSet();
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@userid", userid);
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     if (ds.Tables[0].Rows.Count != 1)
         return null;
     DbModels.manage model = new DbModels.manage();
     model.userid = ds.Tables[0].Rows[0]["f_shzh"].ToString();
     model.id = model.userid;
     model.username = ds.Tables[0].Rows[0]["f_shmc"].ToString();
     model.pwd = privateToDeDES(ds.Tables[0].Rows[0]["f_dlmm"].ToString());
     model.freeze = Convert.ToInt32(ds.Tables[0].Rows[0]["f_sfdj"]);
     return model;
 }
コード例 #22
0
ファイル: AppcategoryDal.cs プロジェクト: buweixiaomi/DydCert
 public Models.DbModels.appcategory GetCategoryInfo(XXF.Db.DbConn PubConn, int typeid, int categoryid)
 {
     string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype  and categoryid=@categoryid";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", typeid);
     para.Add("@categoryid", categoryid);
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     if (ds.Tables[0].Rows.Count == 0)
         return null;
     DataRow dr = ds.Tables[0].Rows[0];
     DbModels.appcategory item = new DbModels.appcategory();
     item.apptype = Convert.ToInt32(dr["apptype"]);
     item.categoryid = Convert.ToInt32(dr["categoryid"]);
     item.categorytitle = dr["categorytitle"].ToString();
     item.categorydesc = dr["categorydesc"].ToString();
     return item;
 }
コード例 #23
0
ファイル: ApiLog.cs プロジェクト: buweixiaomi/DydCert
        public static void AddLog(XXF.Db.DbConn PubConn,DbModels.apilog log)
        {
            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@reqsource", log.reqsource);
            para.Add("@url", log.url);
            para.Add("@reqpara", log.reqpara);
            para.Add("@token", log.token);
            para.Add("@appid", log.appid);
            //    para.Add("@appname", log.appname);
            para.Add("@userid", log.userid);
            para.Add("@username", log.username);
            para.Add("@reqdate", log.reqdate);
            para.Add("@opecontent", log.opecontent);

            string sql = "INSERT INTO operationlog (reqsource  ,url  ,reqpara ,token ,appid ,appname,userid ,username ,reqdate ,opecontent)"+
                             "VALUES (@reqsource,@url, @reqpara,@token,@appid,@appname,@userid, @username,@reqdate,@opecontent)";
            PubConn.ExecuteSql(sql, para.ToParameters());
        }
コード例 #24
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
        public int DeleteGrade(XXF.Db.DbConn PubConn, int apptype, int appgradeno)
        {
            string countsql = "  select COUNT(*) from api where apptype=" + apptype + " and appgradeno=" + appgradeno + "";
            int    c        = (int)PubConn.ExecuteScalar(countsql, null);

            if (c != 0)
            {
                return(-2);
            }
            string sql = "delete from appgrade where  apptype=@apptype and appgradeno=@appgradeno";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", apptype);
            para.Add("@appgradeno", appgradeno);
            int r = PubConn.ExecuteSql(sql, para.ToParameters());

            return(r);
        }
コード例 #25
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
 public DbModels.appgrade GetGradeInfo(XXF.Db.DbConn PubConn, int apptype, int appgradeno)
 {
     string sql = "select apptype,appgradeno,appgradename,appgradedesc from appgrade where apptype=@apptype and appgradeno=@appgradeno ";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", apptype);
     para.Add("@appgradeno", appgradeno);
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     if (ds.Tables[0].Rows.Count == 0)
         return null;
     DataRow dr = ds.Tables[0].Rows[0];
     DbModels.appgrade item = new DbModels.appgrade();
     item.apptype = Convert.ToInt32(dr["apptype"]);
     item.appgradeno = Convert.ToInt32(dr["appgradeno"]);
     item.appgradename = dr["appgradename"].ToString();
     item.appgradedesc = dr["appgradedesc"].ToString();
     return item;
 }
コード例 #26
0
        public int DeleteCategory(XXF.Db.DbConn PubConn, int apptype, int categoryid)
        {
            string countsql = "  select COUNT(*) from gradepermission where apptype=" + apptype + " and categoryid=" + categoryid + "";
            int    c        = (int)PubConn.ExecuteScalar(countsql, null);

            if (c != 0)
            {
                return(-2);
            }
            string sql = "delete from appcategory where  apptype=@apptype and categoryid=@categoryid";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", apptype);
            para.Add("@categoryid", categoryid);
            int r = PubConn.ExecuteSql(sql, para.ToParameters());

            return(r);
        }
コード例 #27
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
 public List<DbModels.appgrade> GetGrades(XXF.Db.DbConn PubConn, int typ)
 {
     List<DbModels.appgrade> listmodel = new List<DbModels.appgrade>();
     string sql = "select apptype,appgradeno,appgradename,appgradedesc from appgrade where apptype=@apptype order by appgradeno asc";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", typ);
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     foreach (DataRow dr in ds.Tables[0].Rows)
     {
         DbModels.appgrade item = new DbModels.appgrade();
         item.apptype = Convert.ToInt32(dr["apptype"]);
         item.appgradeno = Convert.ToInt32(dr["appgradeno"]);
         item.appgradename = dr["appgradename"].ToString();
         item.appgradedesc = dr["appgradedesc"].ToString();
         listmodel.Add(item);
     }
     return listmodel;
 }
コード例 #28
0
        public static void AddLog(XXF.Db.DbConn PubConn, DbModels.apilog log)
        {
            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@reqsource", log.reqsource);
            para.Add("@url", log.url);
            para.Add("@reqpara", log.reqpara);
            para.Add("@token", log.token);
            para.Add("@appid", log.appid);
            //    para.Add("@appname", log.appname);
            para.Add("@userid", log.userid);
            para.Add("@username", log.username);
            para.Add("@reqdate", log.reqdate);
            para.Add("@opecontent", log.opecontent);

            string sql = "INSERT INTO operationlog (reqsource  ,url  ,reqpara ,token ,appid ,appname,userid ,username ,reqdate ,opecontent)" +
                         "VALUES (@reqsource,@url, @reqpara,@token,@appid,@appname,@userid, @username,@reqdate,@opecontent)";

            PubConn.ExecuteSql(sql, para.ToParameters());
        }
コード例 #29
0
ファイル: AppcategoryDal.cs プロジェクト: buweixiaomi/DydCert
 public List<Models.DbModels.appcategory> GetAppTypeCategorys(XXF.Db.DbConn PubConn, int typeid)
 {
     List<DbModels.appcategory> listmodel = new List<DbModels.appcategory>();
     string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype order by categoryid asc";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", typeid);
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     foreach (DataRow dr in ds.Tables[0].Rows)
     {
         DbModels.appcategory item = new DbModels.appcategory();
         item.apptype = Convert.ToInt32(dr["apptype"]);
         item.categoryid = Convert.ToInt32(dr["categoryid"]);
         item.categorytitle = dr["categorytitle"].ToString();
         item.categorydesc = dr["categorydesc"].ToString();
         listmodel.Add(item);
     }
     return listmodel;
 }
コード例 #30
0
ファイル: AccountDal.cs プロジェクト: buweixiaomi/DydCert
        /// <summary></summary>
        public DbModels.manage getUser(XXF.Db.DbConn PubConn, string userid)
        {
            string  sql = "select f_id, f_yhzh,f_yhxm,f_dlmm,f_sfdj from tb_customer where f_yhzh=@userid";
            DataSet ds  = new DataSet();

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@userid", userid);
            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            if (ds.Tables[0].Rows.Count != 1)
            {
                return(null);
            }
            DbModels.manage model = new DbModels.manage();
            model.userid   = ds.Tables[0].Rows[0]["f_yhzh"].ToString();
            model.id       = ds.Tables[0].Rows[0]["f_id"].ToString();
            model.username = ds.Tables[0].Rows[0]["f_yhxm"].ToString();
            model.pwd      = privateToDeDES(ds.Tables[0].Rows[0]["f_dlmm"].ToString());
            model.freeze   = Convert.ToInt32(ds.Tables[0].Rows[0]["f_sfdj"]);
            return(model);
        }
コード例 #31
0
ファイル: AccountDal.cs プロジェクト: buweixiaomi/DydCert
        /// <summary>根据userid得到管理员工信息</summary>
        public DbModels.manage getShop(XXF.Db.DbConn PubConn, string userid)
        {
            string  sql = "SELECT  f_shzh,f_shsj,f_shmc,f_dlmm,f_sfdj FROM [tb_shop] where f_shzh=@userid or f_shsj=@userid";
            DataSet ds  = new DataSet();

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@userid", userid);
            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            if (ds.Tables[0].Rows.Count != 1)
            {
                return(null);
            }
            DbModels.manage model = new DbModels.manage();
            model.userid   = ds.Tables[0].Rows[0]["f_shzh"].ToString();
            model.id       = model.userid;
            model.username = ds.Tables[0].Rows[0]["f_shmc"].ToString();
            model.pwd      = privateToDeDES(ds.Tables[0].Rows[0]["f_dlmm"].ToString());
            model.freeze   = Convert.ToInt32(ds.Tables[0].Rows[0]["f_sfdj"]);
            return(model);
        }
コード例 #32
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
        public List <DbModels.appgrade> GetGrades(XXF.Db.DbConn PubConn, int typ)
        {
            List <DbModels.appgrade> listmodel = new List <DbModels.appgrade>();
            string sql = "select apptype,appgradeno,appgradename,appgradedesc from appgrade where apptype=@apptype order by appgradeno asc";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", typ);
            DataSet ds = new DataSet();

            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                DbModels.appgrade item = new DbModels.appgrade();
                item.apptype      = Convert.ToInt32(dr["apptype"]);
                item.appgradeno   = Convert.ToInt32(dr["appgradeno"]);
                item.appgradename = dr["appgradename"].ToString();
                item.appgradedesc = dr["appgradedesc"].ToString();
                listmodel.Add(item);
            }
            return(listmodel);
        }
コード例 #33
0
        public List <Models.DbModels.appcategory> GetAppTypeCategorys(XXF.Db.DbConn PubConn, int typeid)
        {
            List <DbModels.appcategory> listmodel = new List <DbModels.appcategory>();
            string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype order by categoryid asc";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", typeid);
            DataSet ds = new DataSet();

            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                DbModels.appcategory item = new DbModels.appcategory();
                item.apptype       = Convert.ToInt32(dr["apptype"]);
                item.categoryid    = Convert.ToInt32(dr["categoryid"]);
                item.categorytitle = dr["categorytitle"].ToString();
                item.categorydesc  = dr["categorydesc"].ToString();
                listmodel.Add(item);
            }
            return(listmodel);
        }
コード例 #34
0
        public Models.DbModels.appcategory GetCategoryInfo(XXF.Db.DbConn PubConn, int typeid, int categoryid)
        {
            string sql = "select apptype,categoryid,categorytitle, categorydesc from appcategory where apptype=@apptype  and categoryid=@categoryid";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", typeid);
            para.Add("@categoryid", categoryid);
            DataSet ds = new DataSet();

            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            if (ds.Tables[0].Rows.Count == 0)
            {
                return(null);
            }
            DataRow dr = ds.Tables[0].Rows[0];

            DbModels.appcategory item = new DbModels.appcategory();
            item.apptype       = Convert.ToInt32(dr["apptype"]);
            item.categoryid    = Convert.ToInt32(dr["categoryid"]);
            item.categorytitle = dr["categorytitle"].ToString();
            item.categorydesc  = dr["categorydesc"].ToString();
            return(item);
        }
コード例 #35
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
        public DbModels.appgrade GetGradeInfo(XXF.Db.DbConn PubConn, int apptype, int appgradeno)
        {
            string sql = "select apptype,appgradeno,appgradename,appgradedesc from appgrade where apptype=@apptype and appgradeno=@appgradeno ";

            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@apptype", apptype);
            para.Add("@appgradeno", appgradeno);
            DataSet ds = new DataSet();

            PubConn.SqlToDataSet(ds, sql, para.ToParameters());
            if (ds.Tables[0].Rows.Count == 0)
            {
                return(null);
            }
            DataRow dr = ds.Tables[0].Rows[0];

            DbModels.appgrade item = new DbModels.appgrade();
            item.apptype      = Convert.ToInt32(dr["apptype"]);
            item.appgradeno   = Convert.ToInt32(dr["appgradeno"]);
            item.appgradename = dr["appgradename"].ToString();
            item.appgradedesc = dr["appgradedesc"].ToString();
            return(item);
        }
コード例 #36
0
ファイル: AppDal.cs プロジェクト: buweixiaomi/DydCert
 //get
 public Models.DbModels.app GetAppInfo(XXF.Db.DbConn PubConn, string appid)
 {
     string sql = string.Format(basesql, "  appid,appname,appsecret,app.apptype,appgrade.appgradeno,appgrade.appgradename,appdesc,freeze ");
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@appid", appid);
     sql += " and appid=@appid";
     DataSet ds = new DataSet();
     PubConn.SqlToDataSet(ds, sql, para.ToParameters());
     if (ds.Tables[0].Rows.Count == 0)
         return null;
     return FillModel(ds.Tables[0].Rows[0]);
 }
コード例 #37
0
ファイル: AppGradeDal.cs プロジェクト: buweixiaomi/DydCert
 public int UpdateGrade(XXF.Db.DbConn PubConn, Models.DbModels.appgrade model)
 {
     model.appgradedesc = model.appgradedesc ?? "";
     string sql = "update  appgrade set appgradename=@appgradename,appgradedesc=@appgradedesc where  apptype=@apptype and appgradeno=@appgradeno";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", model.apptype);
     para.Add("@appgradeno", model.appgradeno);
     para.Add("@appgradename", model.appgradename);
     para.Add("@appgradedesc", model.appgradedesc);
     int r = PubConn.ExecuteSql(sql, para.ToParameters());
     return r;
 }
コード例 #38
0
ファイル: AppDal.cs プロジェクト: buweixiaomi/DydCert
        public int UpdateApp(XXF.Db.DbConn PubConn, Models.DbModels.app model)
        {
            string sql = "update app   set appname=@appname,appsecret=@appsecret,appdesc=@appdesc ,freeze=@freeze ,apptype = @apptype,appgradeno =@appgradeno where appid=@appid";
            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            para.Add("@appid", model.appid);
            para.Add("@appsecret", model.appsecret);
            para.Add("@appname", model.appname);
            para.Add("@apptype", model.apptype);
            para.Add("@appgradeno", model.appgradeno);
            para.Add("@freeze", model.freeze);
            para.Add("@appdesc", model.appdesc ?? "");

            int r = PubConn.ExecuteSql(sql, para.ToParameters());
            return r;
        }
コード例 #39
0
ファイル: AppDal.cs プロジェクト: buweixiaomi/DydCert
        public List<Models.DbModels.app> GetList(XXF.Db.DbConn PubConn, int pno, int pagesize, string keywords, out int totalcount)
        {
            totalcount = 0;
            List<Models.DbModels.app> listapp = new List<DbModels.app>();
            string sql = string.Format(basesql, " ROW_NUMBER() over (order by appid) as rownum, appid,appname,appsecret,app.apptype,appgrade.appgradeno,appgrade.appgradename,appdesc,freeze "); ;
            XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
            string con = "";
            if (!string.IsNullOrEmpty(keywords))
            {
                con = " and app.appid like '%' + @keywords + '%' or app.appname like '%' + @keywords + '%' or appname like '%' + @keywords + '%' ";
                para.Add("@keywords", keywords);
                sql = sql + con;
            }
            string querysql = string.Concat("select A.* from (", sql, ") A ", " where A.rownum between ", (pno - 1) * pagesize + 1, " and ", pno * pagesize);
            DataSet ds = new DataSet();
            PubConn.SqlToDataSet(ds, querysql, para.ToParameters());
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                listapp.Add(FillModel(dr));
            }
            totalcount = (int)PubConn.ExecuteScalar(string.Format(basesql, " count(*) ") + con, para.ToParameters());

            return listapp;
        }
コード例 #40
0
ファイル: AppcategoryDal.cs プロジェクト: buweixiaomi/DydCert
 public int UpdateCategory(XXF.Db.DbConn PubConn, Models.DbModels.appcategory model)
 {
     model.categorydesc = model.categorydesc ?? "";
     string sql = "update  appcategory set categorytitle=@categorytitle,categorydesc=@categorydesc where  apptype=@apptype and categoryid=@categoryid";
     XXF.Db.SimpleProcedureParameter para = new XXF.Db.SimpleProcedureParameter();
     para.Add("@apptype", model.apptype);
     para.Add("@categoryid", model.categoryid);
     para.Add("@categorytitle", model.categorytitle);
     para.Add("@categorydesc", model.categorydesc);
     int r = PubConn.ExecuteSql(sql, para.ToParameters());
     return r;
 }