Exemple #1
0
        public async Task <AddEditResponse> Add(SubjectTypeRequest stData)
        {
            var response = new AddEditResponse();

            try
            {
                if (stData.isActive.ToLower() != "true")
                {
                    stData.isActive = "false";
                }
                if (string.IsNullOrEmpty(stData.subectTypeName))
                {
                    response.Status  = "false";
                    response.Message = "Please enter subject type name";
                }
                else
                {
                    var addEditResponse = _subjectTypeData.Add(stData);
                    response.Status  = "true";
                    response.Message = addEditResponse.message;
                }
                return(response);
            }
            catch (Exception e)
            {
                response.Status  = "false";
                response.Message = $"Unable to process - {e.Message}";
                return(response);
            }
        }
Exemple #2
0
        public async Task <ActionResult> Add(SubjectTypeRequest stData)
        {
            var addEditResponse = await _subjectTypeService.Add(stData);

            return(Ok(new AddEditResponse
            {
                Status = addEditResponse.Status,
                Message = addEditResponse.Message,
            }));
        }
Exemple #3
0
 public AddEditMasters Add(SubjectTypeRequest stData)
 {
     try
     {
         string stProc = AddSubjectType;
         var    retVal = new SqlParameter("@Scope_output", 1);
         retVal.Direction = ParameterDirection.Output;
         var pList = new List <SqlParameter>
         {
             new SqlParameter("@SubjectType", stData.subectTypeName ?? stData.subectTypeName),
             new SqlParameter("@Isactive", stData.isActive ?? stData.isActive),
             new SqlParameter("@Comments", stData.comments ?? stData.comments),
             new SqlParameter("@Createdby", stData.createdBy),
             new SqlParameter("@Updatedby", stData.updatedBy),
         };
         var returnData = UtilityDL.FillEntity <AddEditMasters>(stProc, pList);
         return(returnData);
     }
     catch (Exception e)
     {
         throw e;
     }
 }