예제 #1
0
 public ActionResult Update(ItempropertyInfo itempropertyInfo)
 {
     try
     {
         itempropertyInfo.UpdatedBy   = CurrentUserInfo.UserName;
         itempropertyInfo.UpdatedDate = DateTime.Now;
         IItempropertyService itempropertyService = UnityHelper.UnityResolve <IItempropertyService>();
         var data = itempropertyService.UpdateItemproperty(itempropertyInfo);
         LogHelper.LogOperation(CurrentUserInfo.UserCode, string.Format("Update ItempropertyInfo {0},{1}", LogHelper.ChangeEntityToLog(itempropertyInfo), data));
         if (data > 0)
         {
             return(Content("OK"));
         }
         else
         {
             return(Content("Failed"));
         }
     }
     catch (BusinessException bex)
     {
         return(Content(bex.Message));
     }
     catch (Exception ex)
     {
         LogHelper.LogError(ex, "");
         return(Content(ex.Message));
     }
 }
예제 #2
0
        public ActionResult GetItempropertyInfoByID(string id)
        {
            IItempropertyService itempropertyService = UnityHelper.UnityResolve <IItempropertyService>();
            var data = itempropertyService.GetItempropertyByID(id);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
 public ActionResult Delete(string deleteID)
 {
     try
     {
         IItempropertyService itempropertyService = UnityHelper.UnityResolve <IItempropertyService>();
         var data = itempropertyService.DeleteItemproperty(deleteID.Split(',').ToList());
         LogHelper.LogOperation(CurrentUserInfo.UserCode, string.Format("Delete ItempropertyInfo {0},{1}", deleteID, data));
         if (data > 0)
         {
             return(Content("OK"));
         }
         else
         {
             return(Content("Failed"));
         }
     }
     catch (BusinessException bex)
     {
         return(Content(bex.Message));
     }
     catch (Exception ex)
     {
         LogHelper.LogError(ex, "");
         return(Content(ex.Message));
     }
 }
예제 #4
0
        public void Export()
        {
            IItempropertyService itempropertyService = UnityHelper.UnityResolve <IItempropertyService>();
            QueryEntity          qe = InitQueryEntity();

            qe.IsGetAll = true;
            var data = itempropertyService.GetItempropertyByQueryList(qe);

            Export2Excel("Itemproperty.xls", data);
        }
예제 #5
0
        public string GetAllItemproperty()
        {
            IItempropertyService tmpService = UnityHelper.UnityResolve <IItempropertyService>();
            var data = tmpService.GetItempropertyByQueryList(InitQueryEntity());

            Newtonsoft.Json.Converters.IsoDateTimeConverter timeConverter = new Newtonsoft.Json.Converters.IsoDateTimeConverter();
            timeConverter.DateTimeFormat = ConstUtils.CONST_SHOW_DATE_FORMAT;
            var tmpdata = JsonConvert.SerializeObject(data.Tables[2], timeConverter);
            var result  = "{\"total\":" + data.Tables[1].Rows[0]["TotalRecordsCount"].ToString() + ",\"rows\":" + tmpdata + " }";

            return(result);
        }