Ejemplo n.º 1
0
        /// <summary>
        /// 活动表操作历史进行记录
        /// </summary>
        /// <param name="activeID"></param>
        /// <param name="Operation"></param>
        /// <param name="Author"></param>
        /// <param name="HostName"></param>
        /// <param name="IPAddress"></param>
        /// <returns></returns>
        public static int InsertHistoryActions(int activeID, string ObjectType, string AfterValue, string Operation, string Author, string HostName, string IPAddress)
        {
            OprLogManager log = new OprLogManager();

            OprLogModel model = new OprLogModel();

            model.ObjectId   = activeID;
            model.ObjectType = ObjectType;
            model.AfterValue = AfterValue;
            model.Operation  = Operation;
            //model.Author = Author;
            model.Author    = ThreadIdentity.Operator.Name;
            model.HostName  = HostName;
            model.IpAddress = IPAddress;

            int flag = 0;

            using (var client = new OprLogClient())
            {
                var result = client.AddOprLog(model);
                if (result.Result > 0)
                {
                    flag = 1;
                }
            }
            return(flag);
        }
        public ActionResult UpdateCityPaintItem(int pkid, string pid, string displayName, decimal price, string pkids)
        {
            PaintInfoModel model = new PaintInfoModel();

            model.PKID        = pkid;
            model.PID         = pid;
            model.DisplayName = displayName;
            model.Price       = price;
            model.IsCountry   = false;
            bool result = CityPaintManager.UpdateCityPaintModel(model);

            if (!result)
            {
                return(Json(new { msg = "fail" }));
            }
            OprLogManager oprLog = new OprLogManager();

            DataAccess.Entity.OprLog modelLog = new DataAccess.Entity.OprLog();
            modelLog.Author     = User.Identity.Name;
            modelLog.ObjectID   = pkid;
            modelLog.ObjectType = "CityPaint";
            modelLog.Operation  = "修改油漆产品:" + model.DisplayName;
            try
            {
                oprLog.AddOprLog(modelLog);
            }
            catch
            {
            }
            var citys = CityPaintManager.SelectCityRegionList(pkids);
            List <CityPaintModel> cityPaintList = new List <CityPaintModel>();

            if (citys != null && citys.Any())
            {
                foreach (var city in citys)
                {
                    CityPaintModel mo = new CityPaintModel();
                    mo.PaintId     = pkid;
                    mo.CityId      = city.CityID;
                    mo.ProvinceId  = city.ProvinceID;
                    mo.CityName    = city.City;
                    mo.CreatedTime = DateTime.Now;
                    mo.UpdatedTime = DateTime.Now;
                    cityPaintList.Add(mo);
                }
            }
            List <CityPaintModel> existList = new List <CityPaintModel>();

            existList = CityPaintManager.SelectPaintCityList(pkid).ToList();
            //获取所有待更新数据
            var  dt        = GetDtForUpdate(cityPaintList, existList);
            bool allResult = CityPaintManager.BulkSaveCityPaint(dt);

            if (!allResult)
            {
                return(Json(new { msg = "油漆配置城市添加失败" }));
            }

            return(Json(new { msg = "success" }));
        }
Ejemplo n.º 3
0
        public void AddOprLog(int id, string after, string before, string type, string opr)
        {
            OprLogManager OprLogManager = new OprLogManager();
            OprLog        oprModel      = new OprLog();

            oprModel.AfterValue     = after;
            oprModel.BeforeValue    = before;
            oprModel.Author         = User.Identity.Name;
            oprModel.ChangeDatetime = DateTime.Now;
            oprModel.HostName       = Request.UserHostName;
            oprModel.ObjectID       = id;
            oprModel.ObjectType     = type;
            oprModel.Operation      = opr;
            OprLogManager.AddOprLog(oprModel);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 记录操作日志
        /// </summary>
        /// <param name="author">操作人</param>
        /// <param name="objectType">类型  WebAct网站活动</param>
        /// <param name="objectID">活动ID</param>
        /// <param name="operation">操作名称</param>
        /// <returns></returns>
        public static bool InsertOplog(string author, string objectType, int objectID, string operation)
        {
            OprLogManager oprLog = new OprLogManager();
            OprLog        model  = new OprLog();

            model.Author     = author;
            model.ObjectID   = objectID;
            model.ObjectType = objectType;
            model.Operation  = operation;
            //int i =  DALLogger.InsertOprLog(objectType, objectID, operation, author);
            try
            {
                oprLog.AddOprLog(model);
                return(true);
            }
            catch
            {
                return(false);
            }
        }
        public ActionResult UpdateCountryPaintItem(int pkid, string pid, string displayName, decimal price)
        {
            var paintInfo = CityPaintManager.GetCountryPaintByPID(pid);

            if (paintInfo != null && !string.IsNullOrEmpty(paintInfo.DisplayName))
            {
                if (pkid != paintInfo.PKID)
                {
                    return(Json(new { msg = "has" }));
                }
            }
            PaintInfoModel model = new PaintInfoModel();

            model.PKID        = pkid;
            model.PID         = pid;
            model.DisplayName = displayName;
            model.Price       = price;
            model.IsCountry   = true;
            bool result = CityPaintManager.UpdateCountryPaintModel(model);

            if (!result)
            {
                return(Json(new { msg = "fail" }));
            }
            OprLogManager oprLog = new OprLogManager();

            DataAccess.Entity.OprLog modelLog = new DataAccess.Entity.OprLog();
            modelLog.Author     = User.Identity.Name;
            modelLog.ObjectID   = pkid;
            modelLog.ObjectType = "CountryPaint";
            modelLog.Operation  = "修改油漆产品:" + model.DisplayName;
            try
            {
                oprLog.AddOprLog(modelLog);
            }
            catch
            {
            }
            return(Json(new { msg = "success" }));
        }
Ejemplo n.º 6
0
        public static int InsertOprLog(string ObjectType, int ObjectID, string Operation, string Author, string HostName, string IPAddress)
        {
            OprLogManager log = new OprLogManager();

            OprLog model = new OprLog();

            model.ObjectID   = ObjectID;
            model.ObjectType = ObjectType;
            model.Operation  = Operation;
            model.Author     = Author;
            model.HostName   = HostName;
            model.IPAddress  = IPAddress;
            try
            {
                log.AddOprLog(model);
                return(1);
            }
            catch
            {
                return(0);
            }
            //return DALShipping.InsertOprLog(ObjectType,ObjectID, Operation, Author, HostName, IPAddress);
        }
        public ActionResult InsertCountryPaintItem(string pid, string displayName, decimal price)
        {
            var paintInfo = CityPaintManager.GetCountryPaintByPID(pid);

            if (paintInfo != null && !string.IsNullOrEmpty(paintInfo.DisplayName))
            {
                return(Json(new { msg = "has" }));
            }
            PaintInfoModel model = new PaintInfoModel();

            model.PID         = pid;
            model.DisplayName = displayName;
            model.Price       = price;
            model.IsCountry   = true;
            bool result = CityPaintManager.InsertCountryPaintModelModel(model);

            if (!result)
            {
                return(Json(new { msg = "fail" }));
            }
            OprLogManager oprLog = new OprLogManager();

            DataAccess.Entity.OprLog modelLog = new DataAccess.Entity.OprLog();
            modelLog.Author     = User.Identity.Name;
            modelLog.ObjectID   = 0;
            modelLog.ObjectType = "CountryPaint";
            modelLog.Operation  = "添加油漆产品:" + model.DisplayName;
            try
            {
                oprLog.AddOprLog(modelLog);
            }
            catch
            {
            }
            //LoggerManager.InsertOplog(new ConfigHistory() { AfterValue = null, Author = User.Identity.Name, Operation = "添加类目:" + model.CategoryName, ObjectType = "GaiZhuang", ObjectID = "0" });
            return(Json(new { msg = "success" }));
        }