Пример #1
0
        private static List <UploadAccount> GetAccountList()
        {
            List <UploadAccount> list = new List <UploadAccount>();
            DataSet ds = GetAccountDataSet();

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    UploadAccount model = new UploadAccount
                    {
                        AccessKey    = dr["AccessKey"].ToString(),
                        AlbumId      = dr["AlbumId"].ToString(),
                        SecretKey    = dr["SecretKey"].ToString(),
                        Email        = dr["Email"].ToString(),
                        Id           = SafeValueHelper.ToInt32(dr["Id"]),
                        Mobile       = dr["Mobile"].ToString(),
                        NickName     = dr["NickName"].ToString(),
                        OpenKey      = SafeValueHelper.ToString(dr["OpenKey"]),
                        Password     = dr["Password"].ToString(),
                        RegisterTime = SafeValueHelper.ToDateTime(dr["RegisterTime"])
                    };
                    list.Add(model);
                }
            }
            return(list);
        }
Пример #2
0
        public static List <Recomment> GetToUploadList()
        {
            List <Recomment> list = new List <Recomment>();

            try
            {
                ISelectDataSourceFace query = new SelectSQL(TableName.Recomment);
                query.DataBaseAlias = Const.LogConnection;
                query.AddWhere("ImageStatus", ImageStatus.Local);
                DataSet ds = query.ExecuteDataSet();
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    list.AddRange(from DataRow dr in ds.Tables[0].Rows
                                  select new Recomment()
                    {
                        BlogId    = SafeValueHelper.ToInt32(dr["BlogId"]),
                        Category  = (RecommentCategory)SafeValueHelper.ToInt32(dr["Category"]),
                        CoverName = SafeValueHelper.ToString(dr["CoverName"]),
                        Id        = SafeValueHelper.ToInt32(dr["Id"]),
                        Title     = SafeValueHelper.ToString(dr["Title"]),
                    });
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
            return(list);
        }
Пример #3
0
        public static List <ImageUrl> GetToUploadList()
        {
            List <ImageUrl> list = new List <ImageUrl>();

            try
            {
                ISelectDataSourceFace query = new SelectSQL(TableName.ImageUrl);
                query.DataBaseAlias = Const.LogConnection;
                query.AddWhere("ImageStatus", ImageStatus.Local);
                DataSet ds = query.ExecuteDataSet();
                if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                {
                    list.AddRange(from DataRow dr in ds.Tables[0].Rows
                                  select new ImageUrl()
                    {
                        BlogId = SafeValueHelper.ToInt32(dr["BlogId"]),
                        Url    = SafeValueHelper.ToString(dr["Url"]),
                        Id     = SafeValueHelper.ToInt32(dr["Id"])
                    });
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex);
            }
            return(list);
        }
Пример #4
0
 public static int ExistContinutedRecord(string resourceId, ResourceType type)
 {
     try
     {
         ISelectDataSourceFace query = new SelectSQL(TableName.ResourceRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.SelectColumn("BlogId");
         query.AddWhere("ResourceId", resourceId.Trim());
         query.AddWhere("ResourceType", (int)type);
         query.AddWhere("Continued", true);
         return(SafeValueHelper.ToInt32(query.ExecuteScalar()));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(0);
     }
 }
Пример #5
0
 public static int GetFetchId(ResourceType type)
 {
     try
     {
         ISelectDataSourceFace query = new SelectSQL(TableName.FetchRecord);
         query.DataBaseAlias = Const.LogConnection;
         query.SelectColumn("Id");
         query.AddWhere("ResourceType", (int)type);
         query.AddOrderBy("Id", Sort.Descending);
         query.Top = 1;
         return(SafeValueHelper.ToInt32(query.ExecuteScalar()));
     }
     catch (Exception ex)
     {
         Logger.Error(ex);
         return(0);
     }
 }