public Result UpadteBrandingTeamInfo(tblBrandingTeam brandingInfo)
        {
            var result = new Result();

            try
            {
                result.IsSuccess = iBrandingTeam.UpadteBrandingTeamInfo(brandingInfo);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
        public Result InsertBrandingTeamInfo(tblBrandingTeam brandingTeam)
        {
            var result = new Result();

            try
            {
                result.IsSuccess = iBrandingTeam.InsertBrandingTeamInfo(brandingTeam);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(result);
        }
Пример #3
0
        public bool InsertBrandingTeamInfo(tblBrandingTeam brandingTeam)
        {
            try
            {
                _entities.tblBrandingTeams.Add(brandingTeam);
                _entities.SaveChanges();

                return(true);
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }
Пример #4
0
        public JsonResult UpadteBrandingTeamInfo(tblBrandingTeam brandingInfo, string type)
        {
            var result = new Result();

            if (type == "E")
            {
                brandingInfo.UpdatedDate = DateTime.Now;
                result = _brandingTeamManager.UpadteBrandingTeamInfo(brandingInfo);
            }
            else
            {
                brandingInfo.DeletedDate = DateTime.Now;
                result = _brandingTeamManager.UpadteBrandingTeamInfo(brandingInfo);
            }
            return(Json(result));
        }
Пример #5
0
        public JsonResult InsertBrandingTeamInfo(tblBrandingTeam brandingTeam)
        {
            var result = new Result();

            brandingTeam.AddedDate = DateTime.Now;
            brandingTeam.Active    = true;
            try
            {
                result = _brandingTeamManager.InsertBrandingTeamInfo(brandingTeam);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(Json(result));
        }
Пример #6
0
        public bool UpadteBrandingTeamInfo(tblBrandingTeam brandingInfo)
        {
            tblBrandingTeam brandingInfoes = _entities.tblBrandingTeams.FirstOrDefault(x => x.Id == brandingInfo.Id);

            if (brandingInfo != null)
            {
                if (brandingInfo.Name != null)
                {
                    if (brandingInfoes != null)
                    {
                        brandingInfoes.Name = brandingInfo.Name;
                    }
                }
                if (brandingInfo.EmployeeId != null)
                {
                    if (brandingInfoes != null)
                    {
                        brandingInfoes.EmployeeId = brandingInfo.EmployeeId;
                    }
                }
                if (brandingInfo.MobileNumber != null)
                {
                    if (brandingInfoes != null)
                    {
                        brandingInfoes.MobileNumber = brandingInfo.MobileNumber;
                    }
                }
                if (brandingInfo.Email != null)
                {
                    if (brandingInfoes != null)
                    {
                        brandingInfoes.Email = brandingInfo.Email;
                    }
                }
                if (brandingInfo.Active != null)
                {
                    if (brandingInfoes != null)
                    {
                        brandingInfoes.Active = brandingInfo.Active;
                    }
                }
                if (brandingInfo.UpdatedDate != null)
                {
                    if (brandingInfoes != null)
                    {
                        brandingInfoes.UpdatedDate = brandingInfo.UpdatedDate;
                    }
                }
                if (brandingInfo.DeletedDate != null)
                {
                    if (brandingInfoes != null)
                    {
                        brandingInfoes.DeletedDate = brandingInfo.DeletedDate;
                    }
                }
                _entities.Entry(brandingInfoes).State = EntityState.Modified;
                _entities.SaveChanges();
            }
            else
            {
                return(false);
            }
            return(true);
        }