예제 #1
0
        public string Add(TestTypeRequest ttData)
        {
            try
            {
                string stProc = AddTestType;
                var    retVal = new SqlParameter("@Scope_output", 1);
                retVal.Direction = ParameterDirection.Output;
                var pList = new List <SqlParameter>
                {
                    new SqlParameter("@TestType", ttData.testTypeName ?? ttData.testTypeName),
                    new SqlParameter("@Isactive", ttData.isactive ?? ttData.isactive),
                    new SqlParameter("@Comments", ttData.comments ?? ttData.comments),
                    new SqlParameter("@Createdby", ttData.createdby),
                    new SqlParameter("@Updatedby", ttData.updatedby),

                    retVal
                };
                UtilityDL.ExecuteNonQuery(stProc, pList);
                return("Test type added successfully");
            }
            catch (Exception e)
            {
                throw e;
            }
        }
예제 #2
0
 public ActionResult <string> Add(TestTypeRequest ttData)
 {
     try
     {
         var testType = _testTypeService.Add(ttData);
         return(string.IsNullOrEmpty(testType) ? $"Unable to add test type data" : testType);
     }
     catch (Exception e)
     {
         return($"Unable to add  test type data - {e.Message}");
     }
 }
예제 #3
0
        public string Add(TestTypeRequest ttData)
        {
            try
            {
                if (ttData.isactive.ToLower() != "true")
                {
                    ttData.isactive = "false";
                }

                var result = _testTypeData.Add(ttData);
                return(string.IsNullOrEmpty(result) ? $"Unable to add test type data" : result);
            }
            catch (Exception e)
            {
                return($"Unable to add test type data - {e.Message}");
            }
        }