Exemplo n.º 1
0
 public Maticsoft.Model.SNS.UserAlbumDetail DataRowToModel(DataRow row)
 {
     Maticsoft.Model.SNS.UserAlbumDetail detail = new Maticsoft.Model.SNS.UserAlbumDetail();
     if (row != null)
     {
         if ((row["ID"] != null) && (row["ID"].ToString() != ""))
         {
             detail.ID = int.Parse(row["ID"].ToString());
         }
         if ((row["AlbumID"] != null) && (row["AlbumID"].ToString() != ""))
         {
             detail.AlbumID = int.Parse(row["AlbumID"].ToString());
         }
         if ((row["TargetID"] != null) && (row["TargetID"].ToString() != ""))
         {
             detail.TargetID = int.Parse(row["TargetID"].ToString());
         }
         if ((row["Type"] != null) && (row["Type"].ToString() != ""))
         {
             detail.Type = int.Parse(row["Type"].ToString());
         }
         if (row["Description"] != null)
         {
             detail.Description = row["Description"].ToString();
         }
     }
     return detail;
 }
Exemplo n.º 2
0
 public ActionResult AjaxAddToAlbum(FormCollection Fm)
 {
     Maticsoft.Model.SNS.UserAlbumDetail model = new Maticsoft.Model.SNS.UserAlbumDetail();
     Maticsoft.BLL.SNS.UserAlbumDetail detail2 = new Maticsoft.BLL.SNS.UserAlbumDetail();
     int targetID = Globals.SafeInt(Fm["TargetId"], 0);
     int type = (Fm["Type"] == "Product") ? 1 : 0;
     int albumID = Globals.SafeInt(Fm["AlbumId"], 0);
     if (albumID > 0)
     {
         string str = Fm["Des"];
         model.TargetID = targetID;
         model.Type = type;
         model.Description = str;
         model.AlbumUserId = base.currentUser.UserID;
         model.AlbumID = albumID;
         if (detail2.Exists(albumID, targetID, type))
         {
             return base.Content("Repeat");
         }
         if (detail2.AddEx(model))
         {
             return base.Content("Ok");
         }
     }
     return base.Content("No");
 }