Exemplo n.º 1
0
        public void AddMFavorite(string resID)
        {
            string sql = "select * from  YZSysFavorites where uid='" + YZAuthHelper.LoginUserAccount + "' and resid='" + resID + "' and resType='App'";

            if (!DBUtil_APP.Exists(sql))
            {
                string sql3       = "select max(ORDERINDEX) from  YZSysFavorites where uid='" + YZAuthHelper.LoginUserAccount + "'  and resType='App'";
                int    ORDERINDEX = Convert.ToInt32(DBUtil_APP.GetSingle(sql3)) + 1;
                string sql2       = string.Format(@"INSERT INTO [YZSysFavorites]
           (
            [UID]
           ,[RESTYPE]
           ,[RESID]
           ,[DATE]
           ,[COMMENTS]
           ,[ORDERINDEX]
           )
     VALUES
           ('{0}'
           ,'{1}'
           ,'{2}'
           ,'{3}'
           ,'{4}'
           ,'{5}')", YZAuthHelper.LoginUserAccount, "App", resID, DateTime.Now.ToString(), "", ORDERINDEX);
                DBUtil_APP.ExecuteSqlWithGoUseTran(sql2);
            }
        }
Exemplo n.º 2
0
        public AppInfoModule LoadAppInfo(string pid)
        {
            string sql = @"select * from   APP_APPINFO where PID='" + pid + "' ";

            if (DBUtil_APP.Exists("select count(*) from   APP_APPINFO where PID='" + pid + "' "))
            {
                DataTable dt = DBUtil_APP.Query(sql).Tables[0];
                if (dt.Rows.Count > 0)
                {
                    return(YZApp.DataTableToModel.ToSingleModel <AppInfoModule>(dt));
                }
                else
                {
                    return(new AppInfoModule());
                }
            }
            else
            {
                return(new AppInfoModule());
            }
        }