public ActionResult SynchHMNewData()
 {
     try
     {
         HMNUMServices HMSvr  = new HMNUMServices();
         int           retVal = HMSvr.SynchHMNewData();
         return(Json(new NBCMSResultJson
         {
             Status = StatusType.OK,
             Data = "Synchronizing Successfully"
         }));
     }
     catch (Exception ex)//如果存储过程内部发生错,就跳到这里来了。。。。无数据返回-1
     {
         NBCMSLoggerManager.Fatal(ex.Message);
         NBCMSLoggerManager.Fatal(ex.StackTrace);
         NBCMSLoggerManager.Fatal(ex.Source);
         NBCMSLoggerManager.Error("");
         return(Json(new NBCMSResultJson
         {
             Status = StatusType.Exception,
             Data = ex.Message
         }));
     }
 }
 /// <summary>
 /// 获取HMNUM的信息
 /// </summary>
 /// <returns></returns>
 public ActionResult GetHMNUMList(CMS_HMNUM_Model model, int page, int rows)
 {
     try
     {
         HMNUMServices          hSvr  = new HMNUMServices();
         int                    count = 0;
         List <CMS_HMNUM_Model> list  = hSvr.GetHMNUMList(model, page, rows, out count);
         return(Json(new NBCMSResultJson
         {
             Status = StatusType.OK,
             Data = new
             {
                 total = count,
                 rows = list
             }
         }));
     }
     catch (Exception ex)
     {
         NBCMSLoggerManager.Error("");
         NBCMSLoggerManager.Error(ex.Message);
         NBCMSLoggerManager.Error(ex.StackTrace);
         NBCMSLoggerManager.Error("");
         return(Json(new NBCMSResultJson
         {
             Status = StatusType.Exception,
             Data = ex.Message
         }));
     }
 }
        /// <summary>
        /// 更新HMNUMCosting的信息,用于HMNUM Management页面的的inline-edit的编辑更新
        /// 需要注意的是每一次的跟新都将在库表新增一条价格信息,影响将来报表的生成。
        /// CreateDate:2013年11月13日6:00:34
        /// </summary>
        /// <param name="model"></param>
        /// <param name="costing"></param>
        /// <returns></returns>
        public ActionResult EditHMNUMCosting(CMS_HMNUM_Model model, CMS_HM_Costing_Model costing)
        {
            try
            {
                string             cookis      = Request[ConfigurationManager.AppSettings["userInfoCookiesKey"]];
                var                serializer  = new JavaScriptSerializer();
                string             decCookies  = CryptTools.Decrypt(cookis);
                User_Profile_Model curUserInfo = serializer.Deserialize(decCookies, typeof(User_Profile_Model)) as User_Profile_Model;

                HMNUMServices hSvr      = new HMNUMServices();
                Boolean       isCreated = hSvr.EditHMNUMCosting(model, costing, curUserInfo.User_Account);
                return(Json(new NBCMSResultJson
                {
                    Status = isCreated == true ? StatusType.OK : StatusType.Error,
                    Data = isCreated == true ? "Done" : "Fail to udate current HM#'s costing"
                }));
            }
            catch (Exception ex)
            {
                NBCMSLoggerManager.Error("");
                NBCMSLoggerManager.Error(ex.Message);
                NBCMSLoggerManager.Error(ex.StackTrace);
                NBCMSLoggerManager.Error("");
                return(Json(new NBCMSResultJson
                {
                    Status = StatusType.Exception,
                    Data = ex.Message
                }));
            }
        }
        /// <summary>
        /// 批量上传
        /// Change1:新增一个参数ReqIndicator{0:defult,1:HMNUM页面请求,2:SKUOrder页面请求};2014年1月24日14:19:38
        /// </summary>
        /// <param name="reqIndicator"></param>
        /// <returns></returns>
        public ActionResult FilesUpload(int?reqIndicator)
        {
            var reqInd = reqIndicator.ConvertToNotNull();

            ViewBag.ReqIndicator = reqInd;
            ViewBag.SKUID        = Request["SKUID"];//用户传参,上传之后自动让SKUID和图像关联
            ViewBag.ProductID    = Request["ProductID"];
            if (reqInd <= 0)
            {
                return(View(new CMS_HMNUM_Model()));
            }
            var hmSvr    = new HMNUMServices();
            var newHmnum = hmSvr.GetSingleHMNUMByID(Convert.ToInt64(Request["ProductID"]));

            return(View(newHmnum));
            //var newHMNUM = hmSvr.GetSingleHMNUMByID(
        }