Beispiel #1
0
        public int InsertPhoto(Photo objPhoto)
        {
            int retVal = 0;
            try
            {
                DbParam[] param = new DbParam[11];

                param[0] = new DbParam("@PhotoId", objPhoto.PhotoId, SqlDbType.UniqueIdentifier);
                param[1] = new DbParam("@PhotoUrl", objPhoto.PhotoUrl, SqlDbType.VarChar);
                param[2] = new DbParam("@PhotoStatus", objPhoto.PhotoStatus, SqlDbType.VarChar);
                param[3] = new DbParam("@PhotoType", objPhoto.PhotoType, SqlDbType.VarChar);
                param[4] = new DbParam("@IsShared", objPhoto.IsShared, SqlDbType.Bit);
                param[5] = new DbParam("@IsLiked", objPhoto.IsLiked, SqlDbType.Bit);
                param[6] = new DbParam("@UserId", objPhoto.UserId, SqlDbType.UniqueIdentifier);
                param[7] = new DbParam("@PermissionId", objPhoto.PermissionId, SqlDbType.Int);
                param[8] = new DbParam("@IsHidden", objPhoto.IsHidden, SqlDbType.Bit);
                param[9] = new DbParam("@IsArchived", objPhoto.IsArchived, SqlDbType.Bit);
                param[10] = new DbParam("@IsShared1", objPhoto.IsShared1, SqlDbType.Bit);

                retVal = Db.Insert("SP_tblPhoto_Ins", param, true);

                return retVal;
            }
            catch (Exception ex)
            {
                // CommonFunctions.LogError(ex, WINIT.ErrorLog.LogSeverity.Error);
                throw ex;
            }
        }
Beispiel #2
0
 /// <summary>
 /// Function : SharePost
 /// Description : Creates a Duplicate of selected post on the user wall
 /// Inputs : Photo(obj)
 /// </summary>
 /// <returns>int</returns>
 public int SharePost(Photo objPhoto)
 {
     return new PhotoDao().SharePost(objPhoto);
 }
Beispiel #3
0
 Photo GetPhotoObject(DataRow dr)
 {
     try
     {
         Photo objPhoto = new Photo();
         objPhoto.PhotoId = Db.ToGuid((dr["PhotoId"]));
         objPhoto.PhotoUrl = Db.ToString(dr["PhotoUrl"]);
         objPhoto.PhotoStatus = Db.ToString(dr["PhotoStatus"]);
         objPhoto.PhotoType = Db.ToString(dr["PhotoType"]);
         objPhoto.IsShared = Db.ToBoolean(dr["IsShared"]);
         objPhoto.IsLiked = Db.ToBoolean(dr["IsLiked"]);
         objPhoto.UserId = Db.ToGuid((dr["UserId"]));
         objPhoto.PermissionId = Db.ToInteger(dr["PermissionId"]);
         objPhoto.IsHidden = Db.ToBoolean(dr["IsHidden"]);
         objPhoto.IsArchived = Db.ToBoolean(dr["IsArchived"]);
         objPhoto.IsShared1 = Db.ToBoolean(dr["IsShared1"]);
         objPhoto.CreatedDate = Db.ToDateTime(dr["CreatedDate"]);
         objPhoto.ModifiedDate = Db.ToDateTime(dr["ModifiedDate"]);
         if (dr.Table.Columns.Contains("UserName"))
             objPhoto.UserName = Db.ToString(dr["UserName"]);
         if (dr.Table.Columns.Contains("UserImage"))
             objPhoto.UserImage = Db.ToString(dr["UserImage"]);
         //if (dr.Table.Columns.Contains("LikesCount"))
         //    objPhoto.LikesCount = Db.ToInteger(dr["LikesCount"]);
         //if (dr.Table.Columns.Contains("IsLiked"))
         //    objPhoto.IsLiked = Db.ToBoolean(dr["IsLiked"]);
         //if (dr.Table.Columns.Contains("LikeId"))
         //    objPhoto.LikeId = Db.ToGuid(dr["LikeId"]);
         return objPhoto;
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #4
0
 public int InsertPhoto(Photo objPhoto)
 {
     return new PhotoDao().InsertPhoto(objPhoto);
 }