public string Adddetails(details Emp) { //calling EmpRepository Class Method and storing Repsonse var response = repository.AddDetails(Emp); return(response); }
public string AddDetails(details Emp) { connection(); com = new SqlCommand("InsertData", con); com.CommandType = CommandType.StoredProcedure; com.Parameters.AddWithValue("@monnth", Emp.month); com.Parameters.AddWithValue("@reim", Emp.radio); com.Parameters.AddWithValue("@frm", Emp.txtfrm); com.Parameters.AddWithValue("@to", Emp.txtto); com.Parameters.AddWithValue("@purpose", Emp.ddlpurpose); com.Parameters.AddWithValue("@mode", Emp.ddlmode); com.Parameters.AddWithValue("@km", Emp.txtkm); com.Parameters.AddWithValue("@Invno", Emp.txtInvno); com.Parameters.AddWithValue("@amt", Emp.txtamt); com.Parameters.AddWithValue("@file", Emp.FileUpload1); con.Open(); int i = com.ExecuteNonQuery(); con.Close(); if (i >= 1) { return("New details Added Successfully"); } else { return("details Not Added"); } }