public ActionResult Edit(AC_UserModel model)
        {
            ResultModel resultModel = resultModel = new ResultModel();

            model.UpdateUser = "******";
            model.UpdateDt   = DateTime.Now;
            var result = _acUserService.UpdateAC_User(model);

            resultModel.Messages = new List <string> {
                "Edit user success"
            };
            string opera = string.Format("系统用户修改:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);

            LogPackage.InserAC_OperateLog(opera, "System--User-Edit");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
        private void SetupProjectUrl(LogPackage package)
        {
            if (!package.IsLocal)
            {
                package.ProjectUrl = $"https://www.nuget.org/packages/{package.PackageId}/";
                return;
            }

            if (package.IsStatic)
            {
                package.ProjectUrl = $"https://rufc-devbuild.cneu.cnwk/nuget/packages/{package.PackageId}/";
                return;
            }

            package.ProjectUrl = $"http://rufc-devbuild.cneu.cnwk/ccnet/server/Library/project/{package.ProjectName}/ViewProjectReport.aspx";
        }
        /// <summary>
        /// Создает пакет для отправки из архива
        /// </summary>
        /// <param name="LogName">Имя архива</param>
        /// <param name="Path">Путь к архиву</param>
        /// <param name="timestamp">Время нажатия кнопки перед созданием архивов(общее)</param>
        /// <returns></returns>
        public LogPackage CreateLogPacket(string LogName, string Path, DateTime timestamp)
        {
            var LogPacket = new LogPackage
            {
                Token       = HashFunction.Get(PrivateKey.SECRET_WORD),
                WFMId       = TaskImageIdents.WmfId,
                IIN         = TaskImageIdents.IIN,
                UserName    = TaskImageIdents.Username,
                WorkStation = Environment.MachineName,
                TimeStamp   = timestamp,
                Type        = ArmDataPackageType.Log,
                FileName    = LogName,
                FileContent = ArchiveToBase64(Path)
            };

            return(LogPacket);
        }
 /// <summary>
 /// 删除商品咨询 
 /// zhoub 20150827
 /// </summary>
 /// <param name="ParamenterID">用户Id</param>
 /// <returns></returns>
 public JsonResult Delete(long? productConsultId)
 {
     ResultModel resultModel = new ResultModel();
     if (productConsultId.HasValue)
     {
         resultModel = _productConsultService.DeleteProductConsult(productConsultId.Value, ACultureHelper.GetLanguageID);
         resultModel.Messages = new List<string> { resultModel.IsValid == true ? "Success!" : "Failed!" };
     }
     else
     {
         resultModel.IsValid = false;
         resultModel.Messages = new List<string> { "主键Id有误" };
     }
     string opera = string.Format("商品咨询删除:{0},操作结果:{1}", productConsultId, resultModel.Messages);
     LogPackage.InserAC_OperateLog(opera, "Product--Product Consult-Reply");
     return Json(resultModel, JsonRequestBehavior.AllowGet);
 }
Esempio n. 5
0
        public JsonResult IsLogin()
        {
            var    UserName = Request["UserName"];
            var    PassWord = Request["PassWord"];
            string type     = "1";//用户不存在
            string Messages = "Users do not exist";

            try
            {
                AC_UserModel model = this._ac_UserService.GetAC_UserByUserName(UserName).Data;

                if (model != null)
                {
                    if (MD5.Equals(model.Password, FormsAuthentication.HashPasswordForStoringInConfigFile(PassWord, "MD5")) && model.UserMode == 1)
                    {
                        type     = "3";//登陆成功
                        Messages = "Login success";
                        GetAC_UserByUserName(model);
                    }
                    else
                    {
                        type     = "2";//密码不正确
                        Messages = "Password wrong or account locked";
                    }
                }
                var data = new
                {
                    logintype = type,
                    Messages  = Messages,
                };
                return(Json(data));
            }
            catch (Exception ex)
            {
                var data = new
                {
                    logintype = type,
                    Messages  = Messages,
                };

                var opera = string.Format("登录错误-用户名:{0},错误结果:{1}", UserName, ex.Message);
                LogPackage.InserAC_OperateLog(opera, "Login error");

                return(Json(data));
            }
        }
Esempio n. 6
0
        public JsonResult ProductsCheck(string ProductIds, ProductStatus ProductStatus)
        {
            string[] ids  = ProductIds.Split(',');
            long[]   str2 = new long[ids.Length];
            for (int i = 0; i < ids.Length; i++)
            {
                str2[i] = long.Parse(ids[i]);
            }
            var result = this._productService.Check(str2, ProductStatus);

            var opera = string.Format("商品审核:{0},操作结果:{1}", "商品Id:" + ProductIds + (result.IsValid ? "成功" : "失败"),
                                      result.Messages);

            LogPackage.InserAC_OperateLog(opera, "商品管理-审核");

            return(this.Json(result));
        }
        public ActionResult BannerCreate(bannerModel model)
        {
            ViewData["BannerPlaceCodeModel1"] = null;
            ViewBag.ImagePath = ImagePath;
            var opera = string.Empty;

            if (model.IdentityStatus == 3)
            {
                ViewData["BannerPlaceCodeModel1"] = con.GetBannerProducPlaceCodeNameList(ACultureHelper.GetLanguageID, 0, model.IdentityStatus);
            }
            if (ModelState.IsValid)
            {
                ResultModel resultModel = new ResultModel();


                if (model.bannerId != 0)
                {
                    model.UpdateBy       = UserInfo.CurrentUserName;
                    model.UpdateDT       = DateTime.Now;
                    resultModel.Messages = new List <string>()
                    {
                        this._bannerService.UpdateBanner(model).Data > 0 ? "Modify success" : "Modify failed"
                    };
                    opera = " bannerId:" + model.bannerId + ",bannerName:" + model.bannerName + ",bannerUrl:" + model.bannerUrl + ",bannerPic=" + model.bannerPic + ",结果:" + resultModel.Messages;
                    LogPackage.InserAC_OperateLog(opera, "广告管理--分类频道轮播banner-修改");
                }
                else
                {
                    model.bannerId       = MemCacheFactory.GetCurrentMemCache().Increment("commonId");
                    model.CreateBy       = UserInfo.CurrentUserName;
                    model.CreateDT       = DateTime.Now;
                    model.UpdateBy       = UserInfo.CurrentUserName;
                    model.UpdateDT       = DateTime.Now;
                    model.Sorts          = MemCacheFactory.GetCurrentMemCache().Increment("commonId");
                    resultModel.Messages = new List <string>()
                    {
                        this._bannerService.AddBanner(model).Data != 0 ? "Add success" : "Add failed"
                    };
                    opera = " bannerId:" + model.bannerId + ",bannerName:" + model.bannerName + ",bannerUrl:" + model.bannerUrl + ",bannerPic=" + model.bannerPic + ",结果:" + resultModel.Messages;
                    LogPackage.InserAC_OperateLog(opera, "广告管理--分类频道轮播banner-添加");
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }
        public ActionResult Create(ZJ_UserBalanceModel model)
        {
            if (ModelState.IsValid)
            {
                ResultModel resultModel = new ResultModel();

                if (model.AddOrCutAmount >= 0)
                {
                    model.AddOrCutType = 15;
                }
                else
                {
                    model.AddOrCutType = 16;
                    SearchZJ_UserBalanceModel smodel = new SearchZJ_UserBalanceModel();
                    smodel.UserID     = model.UserID;
                    smodel.PagedIndex = 0;
                    smodel.PagedSize  = 100;
                    //获取用户余额,用于判断最多扣款
                    List <ZJ_UserBalanceModel> List = this._zjUserBalanceService.GetZJ_UserBalanceList(smodel).Data;
                    if (List != null && List.Count > 0)
                    {
                        ZJ_UserBalanceModel zjubmodel = List[0];
                        if (zjubmodel.ConsumeBalance + model.AddOrCutAmount < 0)
                        {
                            resultModel.Messages = new List <string> {
                                "Insufficient balance!"
                            };
                            return(Json(resultModel, JsonRequestBehavior.AllowGet));
                        }
                    }
                }
                model.IsDisplay = 1;
                var result = ZJ_UserBalanceCommon.UpdateZJ_UserBalance(model);

                resultModel.Messages = new List <string> {
                    result == true ? "Recharge success!" : "Recharge failed!"
                };
                var opera = string.Empty;
                opera += " UserID:" + model.UserID + ",AddOrCutAmount(充值金额):" + model.AddOrCutAmount + ",结果:" + result;
                LogPackage.InserAC_OperateLog(opera, "账户管理-用户账户信息-余额充值");

                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }
Esempio n. 9
0
        /// <summary>
        /// 添加品牌关联保存
        /// zhoub 20150709
        /// </summary>
        /// <returns></returns>
        public JsonResult AddBrand_Category(int?brandID, int?categoryId)
        {
            Brand_CategoryModel model       = new Brand_CategoryModel();
            ResultModel         resultModel = new ResultModel();

            if (brandID.HasValue && categoryId.HasValue)
            {
                model.Brand_CategoryId = MemCacheFactory.GetCurrentMemCache().Increment("commonId");
                model.BrandID          = (int)brandID;
                model.CategoryId       = (int)categoryId;
                model.AddUser          = UserInfo.CurrentUserName;
                model.AddDate          = DateTime.Now;
                model.IsEnable         = true;
                var result = this._brand_CategoryService.AddBrand_Category(model);
                if (result.IsValid)
                {
                    //添加品牌关联成功
                    resultModel.Messages = new List <string>()
                    {
                        "Add brand association success"
                    };
                }
                else
                {
                    //该品牌关联已经存在.
                    resultModel.Messages = new List <string>()
                    {
                        "The brand association already exists."
                    };
                }
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string>()
                {
                    "Key ID error"
                };
            }
            string opera = string.Format("品牌关联添加:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);

            LogPackage.InserAC_OperateLog(opera, "Product--Brands-Add");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Create(AC_ModuleModel model)
        {
            string opera = "";

            if (ModelState.IsValid)
            {
                var resultModel = new ResultModel();
                if (model.ModuleID != 0)
                {
                    var result = _aC_ModuleService.Update(model);
                    if (result.Data > 0)
                    {
                        resultModel.Messages = new List <string> {
                            "Update system menu success."
                        };
                    }
                    else
                    {
                        resultModel.Messages = result.Messages;
                    }
                    opera = string.Format("系统菜单更新:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);
                    LogPackage.InserAC_OperateLog(opera, "System--Menu-Delete");
                }
                else
                {
                    model.Place = MemCacheFactory.GetCurrentMemCache().Increment("commonId");
                    var result = _aC_ModuleService.Add(model);
                    if (result.Data != null)
                    {
                        resultModel.Messages = new List <string> {
                            "Add system menu success."
                        };
                    }
                    else
                    {
                        resultModel.Messages = result.Messages;
                    }
                    opera = string.Format("系统菜单添加:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);
                    LogPackage.InserAC_OperateLog(opera, "System--Menu-Add");
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }
Esempio n. 11
0
        public JsonResult UpdateOrderStatus(string orderId, int status, string expressOrder)
        {
            var resultModel = new ResultModel();

            if (!string.IsNullOrEmpty(orderId))
            {
                var result             = _acOrederService.UpdateOrderStatus(orderId, status).Data;
                var resultExpressOrder = _acOrederService.UpdateExpressOrder(orderId, expressOrder).Data;
                if (result > 0 && resultExpressOrder > 0)
                {
                    //订单发货记录
                    OrderTrackingLogModel orderTrackingLogOne = new OrderTrackingLogModel();
                    orderTrackingLogOne.OrderID         = orderId;
                    orderTrackingLogOne.OrderStatus     = (int)HKTHMall.Domain.Enum.OrderEnums.OrderStatus.WaitReceiving;
                    orderTrackingLogOne.TrackingContent = "待收货";
                    orderTrackingLogOne.CreateTime      = DateTime.Now;
                    orderTrackingLogOne.CreateBy        = UserInfo.CurrentUserName;
                    _orderTrackingLogService.AddOrderTrackingLog(orderTrackingLogOne);
                    resultModel.Messages = new List <string> {
                        "Success."
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Failed."
                    };
                }
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Key ID error."
                };
            }
            string opera = string.Format("订单发货:{0},操作结果:{1}", "{orderId:" + orderId + ",status:" + status + ",expressOrder:" + expressOrder + "}", resultModel.Messages);

            LogPackage.InserAC_OperateLog(opera, "Order--Orders-Deliver goods");

            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
Esempio n. 12
0
        public ActionResult Create(AC_FunctionModel model)
        {
            var opera = string.Empty;

            if (ModelState.IsValid)
            {
                var resultModel = new ResultModel();
                if (model.FunctionID != 0)
                {
                    var result = _aC_FunctionService.Update(model);
                    if (result.Data > 0)
                    {
                        resultModel.IsValid  = true;
                        resultModel.Messages = new List <string> {
                            "Change system function success"
                        };
                    }
                    else
                    {
                        resultModel.IsValid  = true;
                        resultModel.Messages = new List <string> {
                            "Change system function failed"
                        };
                    }
                    opera = string.Format("修改系统功能参数:{0},结果:{1}", JsonConverts.ToJson(model), resultModel.IsValid ? "成功" : "失败");
                    LogPackage.InserAC_OperateLog(opera, "系统管理--权限管理");
                }
                else
                {
                    var resut = _aC_FunctionService.Add(model);
                    resultModel.Messages = new List <string> {
                        resut.Data != null ? "Add system function success" : "Add system function failed"
                    };
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            else
            {
                DrowList(null);
            }
            return(PartialView(model));
        }
        /// <summary>
        /// 删除Banner
        /// </summary>
        /// <param name="bannerId"></param>
        /// <returns></returns>
        public JsonResult DeleteBanner(long?bannerId)
        {
            bannerProductModel model = new bannerProductModel();



            var resultModel = new ResultModel();

            if (bannerId.HasValue)
            {
                model.bannerProductId = bannerId.Value;
                var result = this._bannerProductService.DeleteBannerProduct(model).IsValid;
                if (result)
                {
                    resultModel.IsValid  = true;
                    resultModel.Messages = new List <string> {
                        "Delete success"
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Delete failed"
                    };
                }

                var opera = string.Empty;
                opera = " bannerProductId:" + model.bannerProductId + ",ProductName:" + model.ProductName + ",PicAddress:" + model.PicAddress + ",PlaceCode=" + model.PlaceCode + ",结果:" + resultModel.Messages;
                LogPackage.InserAC_OperateLog(opera, "APP楼层商品-删除");
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Parameter ID error"
                };
            }

            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
        public ActionResult Create(ProductImageModel model)
        {
            var admin = UserInfo.CurrentUserName;

            if (ModelState.IsValid)
            {
                var resultModel = new ResultModel();
                if (model.ProductImageId != 0)
                {
                    model.UpdateBy = admin;
                    model.UpdateDT = DateTime.Now;
                    model.linkUrl  = !string.IsNullOrEmpty(model.linkUrl) && model.linkUrl.Length > 7 && model.linkUrl.Contains("http://") ? model.linkUrl : string.Empty;
                    var result = _productImageService.Update(model);
                    resultModel.Messages = new List <string>
                    {
                        result.Data > 0 ? "Modify product picture success" : "Modify product picture failed"
                    };
                    var opera = string.Format("修改产品图:{0},操作结果:{1}", JsonConverts.ToJson(model), result.Data > 0 ? "成功" : "失败");
                    LogPackage.InserAC_OperateLog(opera, "企业信息--产品图");
                }
                else
                {
                    model.ProductImageId = MemCacheFactory.GetCurrentMemCache().Increment("commonId");
                    model.CreateBy       = admin;
                    model.CreateDT       = DateTime.Now;
                    model.UpdateBy       = admin;
                    model.UpdateDT       = DateTime.Now;
                    model.linkUrl        = !string.IsNullOrEmpty(model.linkUrl) && model.linkUrl.Length > 7 && model.linkUrl.Contains("http://") ? model.linkUrl : string.Empty;
                    model.place          = MemCacheFactory.GetCurrentMemCache().Increment("commonId");
                    resultModel.Messages = new List <string>
                    {
                        _productImageService.Add(model).Messages.Count == 0 ? "Add product picture success" : "Add product picture failed"
                    };
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            else
            {
                DrowList(null);
            }
            return(PartialView(model));
        }
        public JsonResult NewsInfoCheck(int?ID, int IsCheck)
        {
            var _userName   = UserInfo.CurrentUserName;
            var resultModel = new ResultModel();

            resultModel.Data = IsCheck;
            BD_NewsInfoModel model = new BD_NewsInfoModel();

            if (ID.HasValue)
            {
                model.ID       = ID.Value;
                model.IsCheck  = IsCheck;
                model.UpdateBy = _userName;
                model.UpdateDT = DateTime.Now;
                var result = _bD_NewsInfoService.UpdateState(model);
                resultModel.Messages = new List <string>
                {
                    result.Data > 0 ? "Success" : "Failed"
                };

                #region 推送消息
                try
                {
                    //审核状态为:审核通过并且操作成功,才发送消息
                    if ((IsCheck == (int)EIsCheck.Auditthrough) && result.Data > 0)
                    {
                        //  new BD_NewsInfoService().SendMsgForHFByAsync(ID.Value.ToString());
                    }
                }
                catch (Exception ex)
                {
                    HKSJ.Common.LogHelper.logText(ex.ToString(), "PinMallMVC", 2);
                    var opera1 = string.Format("推送消息:{0},操作结果:{1}", "NewsInfoCheck", ex.Message);
                    LogPackage.InserAC_OperateLog(opera1, "企业信息--新闻信息");
                }
                #endregion

                var opera = string.Format("审核信息:{0},操作结果:{1}", JsonConverts.ToJson(model), result.Data > 0 ? "成功" : "失败");
                LogPackage.InserAC_OperateLog(opera, "企业信息--新闻信息");
            }
            return(this.Json(resultModel));
        }
Esempio n. 16
0
        public ActionResult SelectDaYin(string orderId)
        {
            ViewBag.orderId = orderId;
            dynamic             order;
            YH_MerchantInfoView YH_MerchantInfo = new YH_MerchantInfoView();
            string     orderStatusStr           = "";
            string     payTypeStr = "";
            var        list       = new List <HKTHMall.Domain.AdminModel.Models.Orders.OrderDetailsModel>();
            OrderModel model      = new OrderModel();
            string     Address    = "";
            var        imgpath    = "";

            try
            {
                imgpath = Code.BarCode.GetBarCode.GetTxm(orderId);
                ObjesToPdf.Orderinfo(orderId, 3, out order, out YH_MerchantInfo, out orderStatusStr, out payTypeStr);
                model = order as OrderModel;
                //订单分页详情(商品的信息)
                list = _acOrederService.GetPagingOrderDetails(Convert.ToInt64(orderId), 3).Data as List <HKTHMall.Domain.AdminModel.Models.Orders.OrderDetailsModel>;

                IUserAddressService userAddressService = BrCms.Framework.Infrastructure.BrEngineContext.Current.Resolve <IUserAddressService>();
                //省市区
                var userAddress = userAddressService.GetTHAreaAreaName(model.THAreaID, 3).Data;
                Address = userAddress + model.DetailsAddress;
            }
            catch (Exception ex)
            {
                var opera = string.Format("显示打印详情错误:{0},操作结果:{1}", ex.Message, "失败");
                LogPackage.InserAC_OperateLog(opera, "PDF");
            }

            ViewBag.imgpath         = imgpath;
            ViewBag.list            = list;
            ViewBag.ordermodel      = model;
            ViewBag.YH_MerchantInfo = YH_MerchantInfo;
            ViewBag.orderStatusStr  = orderStatusStr;
            ViewBag.payTypeStr      = payTypeStr;
            ViewBag.Address         = Address;

            //return PartialView();
            return(View());
        }
        public ActionResult Create(FloorConfigModel model)
        {
            if (ModelState.IsValid)
            {
                ResultModel resultModel = new ResultModel();


                var result = _floorConfigService.UpdateFloorConfig(model);

                resultModel.Messages = new List <string> {
                    result.IsValid == true ? "Layer config success!" : "Layer config failed!"
                };
                var opera = string.Empty;
                opera += " FloorConfigId:" + model.FloorConfigId + ",CateIdStr:" + model.CateIdStr + ",结果:" + result;
                LogPackage.InserAC_OperateLog(opera, "广告管理-楼层配置-楼层配置修改");

                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }
Esempio n. 18
0
        public ResponseResult SendLogPackage(LogPackage data)
        {
            var urlPart = LogUrl.urlPart;
            var client  = new RestClient(LogUrl.ServerAndPort);

            client.Timeout = RequestTimeOut;
            var request = GetRequest(urlPart, Method.PUT);

            request.AddBody(data);
            //WITHOUT EXECUTION!!
            //var response = client.Execute(request);
            return(new ResponseResult(RequestResultType.RequestedHostUnavailable));
            //  небольшой хак
            //if (response.StatusCode == 0)
            //{
            //    return new ResponseResult(RequestResultType.RequestedHostUnavailable);
            //}

            //return new ResponseResult((RequestResultType)(int)response.StatusCode);
        }
Esempio n. 19
0
        public ActionResult UpgradeAgentIndex(YH_AgentModel model)
        {
            ResultModel resultModel = new ResultModel();

            if (model.AgentID > 0)
            {
                model.UpdateDT = DateTime.Now;
                model.UpdateBy = UserInfo.CurrentUserName;
                resultModel    = _yh_AgentService.EditYH_Agent(model);
            }
            else
            {
                model.CreateBy = UserInfo.CurrentUserName;
                model.CreateDT = DateTime.Now;
                resultModel    = _yh_AgentService.AddYH_Agent(model);
            }
            string opera = string.Format("升级代理商:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);

            LogPackage.InserAC_OperateLog(opera, "User strategies--Users list--Upgrade Agent");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
Esempio n. 20
0
        /// <summary>
        /// 删除区域信息
        /// zhoub 20150709
        /// </summary>
        /// <returns></returns>
        public JsonResult DelTHArea(int?thAreaId)
        {
            var resultModel = new ResultModel();

            if (thAreaId.HasValue)
            {
                var result = _thAreaService.DelTHArea(thAreaId.Value);
                resultModel.Messages = result.Messages as List <string>;
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Region ID error"
                };
            }
            string opera = string.Format("区域信息删除:{0},操作结果:{1}", thAreaId, resultModel.IsValid);

            LogPackage.InserAC_OperateLog(opera, "System--Region-DelTHArea");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
Esempio n. 21
0
        public JsonResult Add(AddCategoryModel model)
        {
            model.AddDate = DateTime.Now;
            model.AddUser = UserInfo.CurrentUserName;
            model.Grade   = model.ParentGrade + 1;
            if (model.Grade == 3)
            {
                model.CategoryTypeModel = new CategoryTypeModel
                {
                    CategoryTypeId = MemCacheFactory.GetCurrentMemCache().Increment("logId")
                };
            }

            var result = this._categoryService.AddCategory(model);

            var opera = string.Format("添加商品分类:{0},操作结果:{1}", JsonConverts.ToJson(model), result.Messages);

            LogPackage.InserAC_OperateLog(opera, "商品分类-添加");

            return(this.Json(result));
        }
Esempio n. 22
0
        /// <summary>
        ///     Returns the Log Package that was sent by the client.
        ///     Empty Packet when disconnected or empty.
        /// </summary>
        /// <param name="disconnect"></param>
        /// <returns></returns>
        public LogPackage GetPackage(out bool disconnect)
        {
            var availableRead = _client.Available;

            disconnect = false;
            if (availableRead == 0)
            {
                disconnect = !IsConnectionUp();
            }

            if (disconnect || availableRead == 0)
            {
                return(new LogPackage(new byte[0]));
            }


            var lp = LogPackage.ReadBlock(_client.GetStream(), availableRead);


            return(lp);
        }
Esempio n. 23
0
        /// <summary>
        /// 修改区域信息
        /// zhoub 20150709.update by liujc 增加hAreaName
        /// </summary>
        /// <returns></returns>
        public JsonResult EditTHArea(int?areaId, string cAreaName, string eAreaName, string tAreaName, string hAreaName, string shortName, int areaType)
        {
            var resultModel = new ResultModel();

            if (areaId.HasValue)
            {
                var result = _thAreaService.EditTHArea(areaId.Value, cAreaName, eAreaName, tAreaName, hAreaName, shortName, areaType);
                resultModel.Messages = result.Messages as List <string>;
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Region ID error"
                };
            }
            string opera = string.Format("区域信息修改:{0},操作结果:{1}", "{areaId:" + areaId + ",cAreaName:" + cAreaName + ",eAreaName:" + eAreaName + ",tAreaName:" + tAreaName + ",hAreaName" + hAreaName + ",shortName:" + shortName + ",areaType:" + areaType + "}", resultModel.IsValid);

            LogPackage.InserAC_OperateLog(opera, "System--Region-EditTHArea");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
Esempio n. 24
0
        public ActionResult Create(APP_VersionInfoModel model)
        {
            var opera = "";

            ViewBag.IsTrueModel = SelectCommon.GetIsTrueModel();
            ViewBag.GetAppModel = SelectCommon.GetAppModel();
            if (ModelState.IsValid)
            {
                ResultModel resultModel = new ResultModel();

                if (model.ID != 0)
                {
                    model.UpdateBy       = UserInfo.CurrentUserName;//asuser.UserName;
                    model.UpdateDT       = DateTime.Now;
                    resultModel.Messages = new List <string>()
                    {
                        this._aPP_VersionInfoService.UpdateAPP_VersionInfo(model).IsValid != false ? "Modify success" : "Modify failed"
                    };
                    opera = string.Format("修改APP_VersionInfo:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);
                    LogPackage.InserAC_OperateLog(opera, "APP_VersionInfo-修改");
                }
                else
                {
                    model.CreateBy = UserInfo.CurrentUserName;
                    model.CreateDT = DateTime.Now;
                    model.UpdateBy = UserInfo.CurrentUserName;
                    model.UpdateDT = DateTime.Now;


                    resultModel.Messages = new List <string>()
                    {
                        this._aPP_VersionInfoService.AddAPP_VersionInfo(model).IsValid != false ? "Add success" : "Add failed"
                    };
                    opera = string.Format("添加APP_VersionInfo:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);
                    LogPackage.InserAC_OperateLog(opera, "APP_VersionInfo-添加");
                }
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            return(PartialView(model));
        }
Esempio n. 25
0
        /// <summary>
        /// 删除Banner
        /// </summary>
        /// <param name="bannerId"></param>
        /// <returns></returns>

        public JsonResult DeleteAPP_VersionInfo(int?id)
        {
            var model       = new APP_VersionInfoModel();
            var resultModel = new ResultModel();

            if (id.HasValue)
            {
                model.ID = id.Value;
                var result = this._aPP_VersionInfoService.DeleteAPP_VersionInfo(model).IsValid;
                if (result)
                {
                    resultModel.IsValid  = true;
                    resultModel.Messages = new List <string> {
                        "Delete success"
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Delete failed"
                    };
                }

                var opera = string.Empty;

                opera = " bannerId:" + model.ID + ",结果:" + resultModel.Messages;
                LogPackage.InserAC_OperateLog(opera, "删除");
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Parameter ID error"
                };
            }

            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="UserID"></param>
        /// <returns></returns>

        public JsonResult DeleteYH_User(long?UserID)
        {
            YH_AgentModel model       = new YH_AgentModel();
            var           resultModel = new ResultModel();

            if (UserID.HasValue)
            {
                model.UserID = UserID.Value;
                var result = this._yh_AgentService.DeleterYH_Agent(model).IsValid;
                if (result)
                {
                    resultModel.IsValid  = true;
                    resultModel.Messages = new List <string> {
                        "Delete success"
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Delete failed"
                    };
                }

                var opera = string.Empty;

                opera = " UserID:" + model.UserID + ",结果:" + resultModel.Messages;
                LogPackage.InserAC_OperateLog(opera, "供应商-删除");
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Parameter ID error"
                };
            }

            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
Esempio n. 27
0
        public JsonResult Delete(long?bannerId)
        {
            bannerModel model       = new bannerModel();
            var         resultModel = new ResultModel();

            if (bannerId.HasValue)
            {
                model.bannerId = bannerId.Value;
                var result = this._bannerService.DeleteBanner(model).IsValid;
                if (result)
                {
                    resultModel.IsValid  = true;
                    resultModel.Messages = new List <string> {
                        "Delete success"
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Delete failed"
                    };
                }

                var opera = string.Empty;

                opera = " bannerId:" + model.bannerId + ",结果:" + resultModel.Messages;
                LogPackage.InserAC_OperateLog(opera, "广告管理--首页右侧banner-删除");
                return(Json(resultModel, JsonRequestBehavior.AllowGet));
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Parameter ID error"
                };
            }

            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
Esempio n. 28
0
        /// <summary>
        ///     Writes the Log to the UnityConsole.
        /// </summary>
        public override void Flush()
        {
            var lp = new LogPackage(_buffer.ToArray());

            foreach (var l in lp.Logs)
            {
                if (l.Mask == _warnMask)
                {
                    UnityEngine.Debug.LogWarning(l.Message);
                }
                else if (l.Mask == _errorMask)
                {
                    UnityEngine.Debug.LogError(l.Message);
                }
                else
                {
                    UnityEngine.Debug.Log(l.Message);
                }
            }

            _buffer.Clear();
        }
Esempio n. 29
0
        /// <summary>
        /// 删除用户
        /// zhoub 20150714
        /// </summary>
        /// <param name="ParamenterID">用户Id</param>
        /// <returns></returns>
        public JsonResult DeleteYH_User(long?userID, int status)
        {
            var          resultModel = new ResultModel();
            YH_UserModel model       = new YH_UserModel();

            if (userID.HasValue)
            {
                model.UserID   = userID.Value;
                model.IsDelete = status;
                model.UpdateBy = UserInfo.CurrentUserName;
                model.UpdateDT = DateTime.Now;
                var result = _yh_UserService.DeleteYH_UserByUserID(model).Data;
                if (result > 0)
                {
                    resultModel.Messages = new List <string> {
                        "Success"
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Failed."
                    };
                }
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Key ID error"
                };
            }
            string opera = string.Format("商城用户删除:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);

            LogPackage.InserAC_OperateLog(opera, "User strategies--Users list-delete");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }
Esempio n. 30
0
        /// <summary>
        /// 重置用户登录密码
        /// zhoub 20150714
        /// </summary>
        /// <param name="userID"></param>
        /// <returns></returns>
        public JsonResult ResetYH_UserPassWord(long?userID)
        {
            var          resultModel = new ResultModel();
            YH_UserModel model       = new YH_UserModel();

            if (userID.HasValue)
            {
                model.UserID   = userID.Value;
                model.PassWord = FormsAuthentication.HashPasswordForStoringInConfigFile(loginPass, "MD5");
                model.UpdateBy = UserInfo.CurrentUserName;
                model.UpdateDT = DateTime.Now;
                var result = _yh_UserService.UpdateYH_UserPassWord(model).Data;
                if (result > 0)
                {
                    resultModel.Messages = new List <string> {
                        "Reset login password success."
                    };
                }
                else
                {
                    resultModel.IsValid  = false;
                    resultModel.Messages = new List <string> {
                        "Reset login password failed."
                    };
                }
            }
            else
            {
                resultModel.IsValid  = false;
                resultModel.Messages = new List <string> {
                    "Key ID error"
                };
            }
            string opera = string.Format("商城用户重置登录密码:{0},操作结果:{1}", JsonConverts.ToJson(model), resultModel.Messages);

            LogPackage.InserAC_OperateLog(opera, "User strategies--Users list-Reset login password");
            return(Json(resultModel, JsonRequestBehavior.AllowGet));
        }