public string Save(string name) { int n; bool a = int.TryParse(name, out n); if (name != " ") { if (a == false) { if (aTestGateway.IsTestTypeExist(name) == false) { int rowAffected = aTestGateway.Save(name); if (rowAffected >= 0) { return("Save Successfull"); } return("Save Unsuccessfull"); } return("Type Name already exist "); } return("Type Name is invalid"); } return("Type Name is empty"); }
public string Save(Test aTest) { if (aTest.TestName == String.Empty || aTest.Fee == String.Empty) { return("Please Enter Test Name and Fee"); } else { if (Convert.ToDouble(aTest.Fee) < 0) { return("Fee Can't Be Negative!"); } else { if (aTestGateway.DoesTestNameExist(aTest)) { return("Test Name Exists Already!"); } else { return(aTestGateway.Save(aTest)); } } } }
public int Save(Test test) { if (IsTestNameExist(test)) { throw new Exception("Test Name already exist."); } return(testGateway.Save(test)); }
public string Save(TestVM aTest) { if (aTestGateway.IsTestExists(aTest)) { return("Test already exists..."); } else { int rowAffected = aTestGateway.Save(aTest); if (rowAffected > 0) { return("Saved successfully"); } else { return("Saving failed"); } } }
public string Save(TestVM aTest) { if (aTestGateway.IsTestExists(aTest)) { return("2"); } else { int rowAffected = aTestGateway.Save(aTest); if (rowAffected > 0) { return("1"); } else { return("3"); } } }
public int Save(Test test) { return(_testGateway.Save(test)); }