internal string GetUpdateTestSetupInfo(TestTypeSetup aTestTypeSetup) { string Query = @"UPDATE [TestTypeSetup] SET [TypeName] ='" + aTestTypeSetup.Name + "' WHERE ID='" + aTestTypeSetup.ID + "'"; int rowEffect = DataTransfection.ExecuteNonQuery(Query); if (rowEffect > 0) { return("Record is/are Update Sucessfully....!!"); } else { throw new Exception("Record Update Failed....!!! "); } }
internal string SaveTestTypeInformation(TestTypeSetup aTestTypeSetup) { if (aTestTypeSetup.Name == "") { throw new Exception("Enter Test Type Name......!!!!"); } int Count = DataTransfection.GetShowSingleValueInt("COUNT(*)", "ID", "TestTypeSetup", aTestTypeSetup.ID); if (Count > 0) { return(aTestTypeSetupGetaway.GetUpdateTestSetupInfo(aTestTypeSetup)); } return(aTestTypeSetupGetaway.GetSaveTestSetupInfo(aTestTypeSetup)); }
protected void btnSave_Click(object sender, EventArgs e) { try { TestTypeSetup aTestTypeSetup = new TestTypeSetup(); aTestTypeSetup.ID = hfID.Value; aTestTypeSetup.Name = txtTypeName.Text; string Alert = aTestTypeSetupManager.SaveTestTypeInformation(aTestTypeSetup); ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('" + Alert + "');", true); RefreshAll(); } catch (Exception ex) { ClientScript.RegisterStartupScript(this.GetType(), "Warning", "alert('" + ex.Message + "');", true); } }
internal string GetSaveTestSetupInfo(TestTypeSetup aTestTypeSetup) { string Query = @"INSERT INTO [TestTypeSetup] ([TypeName]) VALUES ('" + aTestTypeSetup.Name + "')"; int rowEffect = DataTransfection.ExecuteNonQuery(Query); if (rowEffect > 0) { return("Record is/are Saved Sucessfully....!!"); } else { throw new Exception("Record Save Failed....!!! "); } }