Пример #1
0
        public ResultDto UpdateLoginDetails(EmployeeDto empDto)
        {
            ResultDto resultDto  = new ResultDto();
            string    objectName = "Login Credentials";

            try
            {
                //empDto.RoleId = 3013;
                _dbContext.uspEmployeeLoginDetailsUpdate(empDto.EmployeeID, empDto.RoleId, empDto.LoginUserName, empDto.LoginPassWord, empDto.UserID);
                resultDto.ObjectId = (int)empDto.EmployeeID;

                if (resultDto.ObjectId > 0)
                {
                    resultDto.Message = string.Format("{0} details saved successfully with code : {1}", objectName, empDto.EmployeeCode);
                }
                else if (resultDto.ObjectId == -1)
                {
                    resultDto.Message = string.Format("Error occured while generating {0} code", objectName);
                }
                else
                {
                    resultDto.Message = string.Format("Error occured while saving {0} details", objectName);
                }
            }
            catch (Exception)
            {
                resultDto.Message  = string.Format("Service layer error occured while saving the {0} details", objectName);
                resultDto.ObjectId = -98;
            }

            return(resultDto);
        }