public Result InsertBrandMonitorSubCategoryInfo(BrandMonitorSubCategory subInfo)
        {
            var result = new Result();

            try
            {
                result.IsSuccess = _ibrand.InsertBrandMonitorSubCategoryInfo(subInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
        public Result UpdateBrandSubCategoryInformation(BrandMonitorSubCategory subcatergoryInfo)
        {
            var result = new Result();

            try
            {
                result.IsSuccess = _ibrand.UpdateBrandSubCategoryInformation(subcatergoryInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Beispiel #3
0
        public bool InsertBrandMonitorSubCategoryInfo(BrandMonitorSubCategory subInfo)
        {
            try
            {
                _entities.BrandMonitorSubCategories.Add(subInfo);
                _entities.SaveChanges();


                return(true);
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }
        public JsonResult UpdateBrandSubCategoryInformation(BrandMonitorSubCategory subcatergoryInfo, string type)
        {
            var result = new Result();

            if (type == "E")
            {
                //brandMonitorInfo.EditedBy = Id;
                subcatergoryInfo.EditedDate = DateTime.Now;
                result = _brandManager.UpdateBrandSubCategoryInformation(subcatergoryInfo);
            }
            else
            {
                subcatergoryInfo.DeletedDate = DateTime.Now;

                result = _brandManager.UpdateBrandSubCategoryInformation(subcatergoryInfo);
            }
            return(Json(result));
        }
        public JsonResult InsertBrandMonitorSubCategoryInfo(BrandMonitorSubCategory subInfo)
        {
            var userId = (long)_sessiondictionary[1].Id;
            // var userName = (long)_sessiondictionary[2].Id;

            var result = new Result();

            try
            {
                subInfo.AddedBy   = userId;
                subInfo.AddedDate = DateTime.Now;
                subInfo.Active    = true;
                result            = _brandManager.InsertBrandMonitorSubCategoryInfo(subInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(Json(result));
        }
Beispiel #6
0
        public bool UpdateBrandSubCategoryInformation(BrandMonitorSubCategory subcatergoryInfo)
        {
            BrandMonitorSubCategory brandMonitorsubcategoryInfoes = _entities.BrandMonitorSubCategories.FirstOrDefault(x => x.Id == subcatergoryInfo.Id);

            if (subcatergoryInfo != null)
            {
                if (subcatergoryInfo.Name != null)
                {
                    if (brandMonitorsubcategoryInfoes != null)
                    {
                        brandMonitorsubcategoryInfoes.Name = subcatergoryInfo.Name;
                    }
                }
                if (subcatergoryInfo.Type != null)
                {
                    if (brandMonitorsubcategoryInfoes != null)
                    {
                        brandMonitorsubcategoryInfoes.Type = subcatergoryInfo.Type;
                    }
                }
                if (subcatergoryInfo.Duration != null)
                {
                    if (brandMonitorsubcategoryInfoes != null)
                    {
                        brandMonitorsubcategoryInfoes.Duration = subcatergoryInfo.Duration;
                    }
                }
                if (subcatergoryInfo.DurationType != null)
                {
                    if (brandMonitorsubcategoryInfoes != null)
                    {
                        brandMonitorsubcategoryInfoes.DurationType = subcatergoryInfo.DurationType;
                    }
                }

                if (subcatergoryInfo.Active != null)
                {
                    if (brandMonitorsubcategoryInfoes != null)
                    {
                        brandMonitorsubcategoryInfoes.Active = subcatergoryInfo.Active;
                    }
                }
                if (subcatergoryInfo.EditedDate != null)
                {
                    if (brandMonitorsubcategoryInfoes != null)
                    {
                        brandMonitorsubcategoryInfoes.EditedDate = subcatergoryInfo.EditedDate;
                    }
                }

                if (subcatergoryInfo.DeletedDate != null)
                {
                    if (brandMonitorsubcategoryInfoes != null)
                    {
                        brandMonitorsubcategoryInfoes.DeletedDate = subcatergoryInfo.DeletedDate;
                    }
                }

                _entities.Entry(brandMonitorsubcategoryInfoes).State = EntityState.Modified;
                _entities.SaveChanges();
            }

            else
            {
                return(false);
            }

            return(true);
        }