public int Addcompanydetails(companydetails companydetails)
        {
            SqlConnection sqlConnection1 = new SqlConnection(ConfigurationManager.ConnectionStrings["PayrollContext"].ConnectionString);
            SqlCommand    cmd            = new SqlCommand();

            cmd.CommandText = "SP_tbl_Company";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@Mode", "Insert"));
            cmd.Parameters.Add(new SqlParameter("@AddressLine1", companydetails.AddressLine1));
            cmd.Parameters.Add(new SqlParameter("@AddressLine2", companydetails.AddressLine2));
            cmd.Parameters.Add(new SqlParameter("@AddressLine3", companydetails.AddressLine3));
            cmd.Parameters.Add(new SqlParameter("@city", companydetails.city));
            cmd.Parameters.Add(new SqlParameter("@CompanyLogo", companydetails.CompanyLogo));
            cmd.Parameters.Add(new SqlParameter("@CompanyName", companydetails.CompanyName));
            cmd.Parameters.Add(new SqlParameter("@ContactNo1", companydetails.ContactNo1));
            cmd.Parameters.Add(new SqlParameter("@ContactNo2", companydetails.ContactNo2));
            cmd.Parameters.Add(new SqlParameter("@Country", companydetails.Country));
            cmd.Parameters.Add(new SqlParameter("@CUser", companydetails.CUser));
            cmd.Parameters.Add(new SqlParameter("@EmailId", companydetails.EmailId));
            cmd.Parameters.Add(new SqlParameter("@FaxNo", companydetails.FaxNo));
            cmd.Parameters.Add(new SqlParameter("@FoundedYear", companydetails.FoundedYear));
            cmd.Parameters.Add(new SqlParameter("@Founder1", companydetails.Founder1));
            cmd.Parameters.Add(new SqlParameter("@Founder2", companydetails.Founder2));
            cmd.Parameters.Add(new SqlParameter("@Founder3", companydetails.Founder3));
            cmd.Parameters.Add(new SqlParameter("@Founder4", companydetails.Founder4));
            cmd.Parameters.Add(new SqlParameter("@Founder5", companydetails.Founder5));
            cmd.Parameters.Add(new SqlParameter("@PostalCode", companydetails.potalcode));
            cmd.Parameters.Add(new SqlParameter("@state", companydetails.state));

            cmd.Connection = sqlConnection1;

            sqlConnection1.Open();

            int rv = cmd.ExecuteNonQuery();

            sqlConnection1.Close();
            cmd.Dispose();
            sqlConnection1.Dispose();

            return(rv);
        }
        public int Deletecompanydetails(companydetails companydetails)
        {
            SqlConnection sqlConnection1 = new SqlConnection(ConfigurationManager.ConnectionStrings["PayrollContext"].ConnectionString);
            SqlCommand    cmd            = new SqlCommand();

            cmd.CommandText = "SP_tbl_Company";
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.Add(new SqlParameter("@Mode", "Delete"));
            cmd.Parameters.Add(new SqlParameter("@Id", companydetails.Id));
            cmd.Connection = sqlConnection1;

            sqlConnection1.Open();

            int rv = cmd.ExecuteNonQuery();

            sqlConnection1.Close();
            cmd.Dispose();
            sqlConnection1.Dispose();

            return(rv);
        }