예제 #1
0
 public ActionResult Update(ItembrandInfo itembrandInfo)
 {
     try
     {
         itembrandInfo.UpdatedBy   = CurrentUserInfo.UserName;
         itembrandInfo.UpdatedDate = DateTime.Now;
         IItembrandService itembrandService = UnityHelper.UnityResolve <IItembrandService>();
         var data = itembrandService.UpdateItembrand(itembrandInfo);
         LogHelper.LogOperation(CurrentUserInfo.UserCode, string.Format("Update ItembrandInfo {0},{1}", LogHelper.ChangeEntityToLog(itembrandInfo), 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 GetItembrandInfoByID(string id)
        {
            IItembrandService itembrandService = UnityHelper.UnityResolve <IItembrandService>();
            var data = itembrandService.GetItembrandByID(id);

            return(Json(data, JsonRequestBehavior.AllowGet));
        }
예제 #3
0
 public ActionResult Delete(string deleteID)
 {
     try
     {
         IItembrandService itembrandService = UnityHelper.UnityResolve <IItembrandService>();
         var data = itembrandService.DeleteItembrand(deleteID.Split(',').ToList());
         LogHelper.LogOperation(CurrentUserInfo.UserCode, string.Format("Delete ItembrandInfo {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()
        {
            IItembrandService itembrandService = UnityHelper.UnityResolve <IItembrandService>();
            QueryEntity       qe = InitQueryEntity();

            qe.IsGetAll = true;
            var data = itembrandService.GetItembrandByQueryList(qe);

            Export2Excel("Itembrand.xls", data);
        }
예제 #5
0
        public string GetAllItembrand()
        {
            IItembrandService tmpService = UnityHelper.UnityResolve <IItembrandService>();
            var data = tmpService.GetItembrandByQueryList(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);
        }