Пример #1
0
 public ActionResult Search(CustomerViewModels model)
 {
     try
     {
         var datas = _factory.GetListCustomer(model.StoreID, null, CurrentUser.ListOrganizationId);
         foreach (var item in datas)
         {
             item.ImageURL = string.IsNullOrEmpty(item.ImageURL) ? Commons.Image100_100 : item.ImageURL;
             if (!string.IsNullOrEmpty(item.IC) && item.IC.Length > 8)
             {
                 item.IC = "****" + item.IC.Substring(item.IC.Length - 4, 4);
             }
             else
             {
                 item.IC = "********";
             }
             if (!string.IsNullOrEmpty(item.Phone) && item.Phone.Length > 8)
             {
                 item.Phone = "****" + item.Phone.Substring(item.Phone.Length - 4, 4);
             }
             else
             {
                 item.Phone = "********";
             }
             if (!string.IsNullOrEmpty(item.Email) && item.Email.Length > 8)
             {
                 item.Email = item.Email.Substring(0, 4) + "****";
             }
             else
             {
                 item.Email = "********";
             }
             if (string.IsNullOrEmpty(item.Name))
             {
                 item.Name = item.Email;
             }
         }
         model.ListItem = datas;
     }
     catch (Exception e)
     {
         _logger.Error("Customer_Search: " + e);
         return(new HttpStatusCodeResult(400, e.Message));
     }
     return(PartialView("_ListData", model));
 }
Пример #2
0
 public ActionResult Search(CustomerViewModels model)
 {
     try
     {
         var data = _factory.GetListCustomer();
         model.ListCus = data;
     }
     catch (Exception e)
     {
         NSLog.Logger.Error("GetListCustomer: ", e);
         return(new HttpStatusCodeResult(400, e.Message));
     }
     return(PartialView("_ListData", model));
 }