示例#1
0
 public ActionResult AjaxRecommandOperation(FormCollection fm)
 {
     if (base.UserPrincipal.HasPermissionID(base.GetPermidByActID(base.Act_ApproveList)))
     {
         string str = fm["Type"];
         string str2 = fm["TargetType"];
         int productId = Globals.SafeInt(fm["TargetId"], 0);
         if (((productId > 0) && !string.IsNullOrEmpty(str)) && !string.IsNullOrEmpty(str2))
         {
             if (str2 == "product")
             {
                 Products products = new Products();
                 if (products.UpdateRecomend(productId, (str == "recommand") ? 1 : 0))
                 {
                     return base.Content("Yes");
                 }
             }
             else
             {
                 Photos photos = new Photos();
                 if (photos.UpdateRecomend(productId, (str == "recommand") ? 1 : 0))
                 {
                     return base.Content("Yes");
                 }
             }
         }
     }
     return base.Content("No");
 }