public int Create(EmployeeSalary obj)
        {
            SqlConnection sqlcon = new SqlConnection(Constants.ConnectionString);

            try
            {
                SqlCommand cmd = new SqlCommand("CreateEmployeeSalary", sqlcon);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@Es_Emp_Id", obj.Es_Emp_Id);
                cmd.Parameters.AddWithValue("@Es_Date", obj.Es_Date);
                cmd.Parameters.AddWithValue("@Es_Salary", obj.Es_Salary);
                sqlcon.Open();
                return(Convert.ToInt32(cmd.ExecuteScalar()));
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sqlcon.Close();
            }
        }
        public static ArrayList List(string FromDate, string ToDate, int EmpId, string Department)
        {
            ArrayList     list   = new ArrayList();
            SqlConnection sqlcon = new SqlConnection(Constants.ConnectionString);

            try
            {
                SqlCommand cmd = new SqlCommand("ListEmployeeSalary", sqlcon);
                cmd.Parameters.AddWithValue("@FromDate", FromDate);
                cmd.Parameters.AddWithValue("@ToDate", ToDate);
                cmd.Parameters.AddWithValue("@EmpId", EmpId);
                cmd.Parameters.AddWithValue("@Department", Department);
                cmd.CommandType = CommandType.StoredProcedure;
                sqlcon.Open();
                SqlDataReader rd = cmd.ExecuteReader();
                while (rd.Read())
                {
                    EmployeeSalary obj = new EmployeeSalary();
                    obj.Es_Emp_Id    = Convert.ToInt32(rd["Emp_Id"]);
                    obj.EmployeeName = Convert.ToString(rd["Emp_Name"]);
                    obj.Department   = Convert.ToString(rd["Emp_Department"]);
                    obj.Average      = Convert.ToDecimal(rd["Average"]);

                    list.Add(obj);
                }
            }
            catch (SqlException ex)
            {
                throw ex;
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                sqlcon.Close();
            }
            return(list);
        }