public void EmployeeAdd(EmployeeInfo employeeinfo)
        {
            try
            {

                SPEmployee.EmployeeAdd(employeeinfo);
            }
            catch (Exception ex)
            {

                MessageBox.Show("EC1:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
        /// <summary>
        /// Function to insert values to Employee Table and returns last identity
        /// </summary>
        /// <param name="employeeinfo"></param>
        /// <returns></returns>
        public decimal EmployeeAddWithReturnIdentity(EmployeeInfo employeeinfo)
        {
            decimal decEmployee = -1;
            try
            {
                decEmployee = SPEmployee.EmployeeAddWithReturnIdentity(employeeinfo);
            }
            catch (Exception ex)
            {

                MessageBox.Show("EC11:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return decEmployee;
        }
        /// <summary>
        /// Function to insert values to Employee Table if not exist employee code
        /// </summary>
        /// <param name="employeeinfo"></param>
        /// <returns></returns>
        public bool EmployeeAddIfNotExistsEmployeeCode(EmployeeInfo employeeinfo)
        {
            bool isSave = false;
            try
            {
                isSave = SPEmployee.EmployeeAddIfNotExistsEmployeeCode(employeeinfo);
            }
            catch (Exception ex)
            {

                MessageBox.Show("EC5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return isSave;
        }
 /// <summary>
 /// Function to get all details for search based on parameter
 /// </summary>
 /// <param name="strUnitName"></param>
 /// <returns></returns>
 public List<DataTable> UnitSearch(string strUnitName)
 {
     EmployeeInfo infoEmployee = new EmployeeInfo();
     List<DataTable> ListObj = new List<DataTable>();
     DataTable dtbl = new DataTable();
     try
     {
         SqlDataAdapter sqlda = new SqlDataAdapter("UnitSearch", sqlcon);
         sqlda.SelectCommand.CommandType = CommandType.StoredProcedure;
         dtbl.Columns.Add("SLNO", typeof(decimal));
         dtbl.Columns["SLNO"].AutoIncrement = true;
         dtbl.Columns["SLNO"].AutoIncrementSeed = 1;
         dtbl.Columns["SLNO"].AutoIncrementStep = 1;
         sqlda.SelectCommand.Parameters.Add("@unitName", SqlDbType.VarChar).Value = strUnitName;
         sqlda.Fill(dtbl);
         ListObj.Add(dtbl);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     return ListObj;
 }
        /// <summary>
        /// Function to get particular values from employee table based on the parameter
        /// </summary>
        /// <param name="employeeId"></param>
        /// <returns></returns>
        public EmployeeInfo SalesmanViewSpecificFeilds(decimal employeeId)
        {
            EmployeeInfo infoemployee = new EmployeeInfo();
            try
            {

                infoemployee = SPEmployee.SalesmanViewSpecificFeilds(employeeId);
            }
            catch (Exception ex)
            {

                MessageBox.Show("EC14:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return infoemployee;
        }
        /// <summary>
        /// Function to Update values in employee Table for salesman
        /// </summary>
        /// <param name="employeeinfo"></param>
        /// <returns></returns>
        public bool SalesmanEdit(EmployeeInfo employeeinfo)
        {
            bool isEdit = false;
            try
            {
                isEdit = SPEmployee.SalesmanEdit(employeeinfo);
            }
            catch (Exception ex)
            {

                MessageBox.Show("EC16:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return isEdit;
        }
        /// <summary>
        /// Function to get particular values from Employee table based on the parameter
        /// </summary>
        /// <param name="employeeId"></param>
        /// <returns></returns>
        public EmployeeInfo EmployeeView(decimal employeeId)
        {
            EmployeeInfo infoemployee = new EmployeeInfo();
            try
            {

                infoemployee = SPEmployee.EmployeeView(employeeId);
            }
            catch (Exception ex)
            {

                MessageBox.Show("EC8:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return infoemployee;
        }
 /// <summary>
 /// Function to search the employee
 /// </summary>
 /// <param name="infoEmployee"></param>
 /// <returns></returns>
 public List<DataTable> EmployeeSearch(EmployeeInfo infoEmployee)
 {
     List<DataTable> listObj = new List<DataTable>();
     try
     {
         listObj = SPEmployee.EmployeeSearch(infoEmployee);
     }
     catch (Exception ex)
     {
         MessageBox.Show("EC7:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     return listObj;
 }
 /// <summary>
 /// Function to search the employee
 /// </summary>
 /// <param name="infoEmployee"></param>
 /// <returns></returns>
 public List<DataTable> EmployeeSearch(EmployeeInfo infoEmployee)
 {
     List<DataTable> listObj = new List<DataTable>();
     DataTable dtblEmployee = new DataTable();
     try
     {
         SqlDataAdapter sqlda = new SqlDataAdapter("EmployeeSearch", sqlcon);
         sqlda.SelectCommand.CommandType = CommandType.StoredProcedure;
         dtblEmployee.Columns.Add("SlNo", typeof(decimal));
         dtblEmployee.Columns["SlNo"].AutoIncrement = true;
         dtblEmployee.Columns["SlNo"].AutoIncrementSeed = 1;
         dtblEmployee.Columns["SlNo"].AutoIncrementStep = 1;
         sqlda.SelectCommand.Parameters.Add("@employeeCode", SqlDbType.VarChar).Value = infoEmployee.EmployeeCode;
         sqlda.SelectCommand.Parameters.Add("@employeeName", SqlDbType.VarChar).Value = infoEmployee.EmployeeName;
         sqlda.SelectCommand.Parameters.Add("@designationId", SqlDbType.Decimal).Value = infoEmployee.DesignationId;
         sqlda.SelectCommand.Parameters.Add("@salaryType", SqlDbType.VarChar).Value = infoEmployee.SalaryType;
         sqlda.SelectCommand.Parameters.Add("@bankAccountNumber", SqlDbType.VarChar).Value = infoEmployee.BankAccountNumber;
         sqlda.SelectCommand.Parameters.Add("@passportNumber", SqlDbType.VarChar).Value = infoEmployee.PassportNo;
         sqlda.SelectCommand.Parameters.Add("@labourCardNumber", SqlDbType.VarChar).Value = infoEmployee.LabourCardNumber;
         sqlda.SelectCommand.Parameters.Add("@visaNumber", SqlDbType.VarChar).Value = infoEmployee.VisaNumber;
         sqlda.Fill(dtblEmployee);
         listObj.Add(dtblEmployee);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     return listObj;
 }
        /// <summary>
        /// Function to get particular values from Employee table based on the parameter
        /// </summary>
        /// <param name="employeeId"></param>
        /// <returns></returns>
        public EmployeeInfo EmployeeView(decimal employeeId)
        {
            EmployeeInfo infoemployee = new EmployeeInfo();
            SqlDataReader sqldr = null;
            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sqlcmd = new SqlCommand("EmployeeView", sqlcon);
                sqlcmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();
                sprmparam = sqlcmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
                sprmparam.Value = employeeId;
                sqldr = sqlcmd.ExecuteReader();
                while (sqldr.Read())
                {
                    infoemployee.EmployeeId = Convert.ToDecimal(sqldr["employeeId"].ToString());
                    infoemployee.DesignationId = Convert.ToDecimal(sqldr["designationId"].ToString());
                    infoemployee.EmployeeName = sqldr["employeeName"].ToString();
                    infoemployee.EmployeeCode = sqldr["employeeCode"].ToString();
                    infoemployee.Dob = Convert.ToDateTime(sqldr["dob"].ToString());
                    infoemployee.MaritalStatus = sqldr["maritalStatus"].ToString();
                    infoemployee.Gender = sqldr["gender"].ToString();
                    infoemployee.Qualification = sqldr["qualification"].ToString();
                    infoemployee.Address = sqldr["address"].ToString();
                    infoemployee.PhoneNumber = sqldr["phoneNumber"].ToString();
                    infoemployee.MobileNumber = sqldr["mobileNumber"].ToString();
                    infoemployee.Email = sqldr["email"].ToString();
                    infoemployee.JoiningDate = Convert.ToDateTime(sqldr["joiningDate"].ToString());
                    infoemployee.TerminationDate = Convert.ToDateTime(sqldr["terminationDate"].ToString());
                    infoemployee.IsActive = bool.Parse(sqldr["isActive"].ToString());
                    infoemployee.Narration = sqldr["narration"].ToString();
                    infoemployee.BloodGroup = sqldr["bloodGroup"].ToString();
                    infoemployee.PassportNo = sqldr["passportNo"].ToString();
                    infoemployee.PassportExpiryDate = Convert.ToDateTime(sqldr["passportExpiryDate"].ToString());
                    infoemployee.LabourCardNumber = sqldr["labourCardNumber"].ToString();
                    infoemployee.LabourCardExpiryDate = Convert.ToDateTime(sqldr["labourCardExpiryDate"].ToString());
                    infoemployee.VisaNumber = sqldr["visaNumber"].ToString();
                    infoemployee.VisaExpiryDate = Convert.ToDateTime(sqldr["visaExpiryDate"].ToString());
                    infoemployee.SalaryType = sqldr["salaryType"].ToString();
                    infoemployee.DailyWage = Convert.ToDecimal(sqldr["dailyWage"].ToString());
                    infoemployee.BankName = sqldr["bankName"].ToString();
                    infoemployee.BranchName = sqldr["branchName"].ToString();
                    infoemployee.BankAccountNumber = sqldr["bankAccountNumber"].ToString();
                    infoemployee.BranchCode = sqldr["branchCode"].ToString();
                    infoemployee.PanNumber = sqldr["panNumber"].ToString();
                    infoemployee.PfNumber = sqldr["pfNumber"].ToString();
                    infoemployee.EsiNumber = sqldr["esiNumber"].ToString();

                    infoemployee.DefaultPackageId = Convert.ToDecimal(sqldr["defaultPackageId"].ToString());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sqldr.Close();
                sqlcon.Close();
            }
            return infoemployee;
        }
 /// <summary>
 /// Function to Update values in Employee Table
 /// </summary>
 /// <param name="employeeinfo"></param>
 /// <returns></returns>
 public bool EmployeeEdit(EmployeeInfo employeeinfo)
 {
     bool isEdit = false;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("EmployeeEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
         sprmparam.Value = employeeinfo.EmployeeId;
         sprmparam = sccmd.Parameters.Add("@designationId", SqlDbType.Decimal);
         sprmparam.Value = employeeinfo.DesignationId;
         sprmparam = sccmd.Parameters.Add("@employeeName", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.EmployeeName;
         sprmparam = sccmd.Parameters.Add("@employeeCode", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.EmployeeCode;
         sprmparam = sccmd.Parameters.Add("@dob", SqlDbType.DateTime);
         sprmparam.Value = employeeinfo.Dob;
         sprmparam = sccmd.Parameters.Add("@maritalStatus", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.MaritalStatus;
         sprmparam = sccmd.Parameters.Add("@gender", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Gender;
         sprmparam = sccmd.Parameters.Add("@qualification", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Qualification;
         sprmparam = sccmd.Parameters.Add("@address", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Address;
         sprmparam = sccmd.Parameters.Add("@phoneNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.PhoneNumber;
         sprmparam = sccmd.Parameters.Add("@mobileNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.MobileNumber;
         sprmparam = sccmd.Parameters.Add("@email", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Email;
         sprmparam = sccmd.Parameters.Add("@joiningDate", SqlDbType.DateTime);
         sprmparam.Value = employeeinfo.JoiningDate;
         sprmparam = sccmd.Parameters.Add("@terminationDate", SqlDbType.DateTime);
         sprmparam.Value = employeeinfo.TerminationDate;
         sprmparam = sccmd.Parameters.Add("@active", SqlDbType.Bit);
         sprmparam.Value = employeeinfo.IsActive;
         sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Narration;
         sprmparam = sccmd.Parameters.Add("@bloodGroup", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.BloodGroup;
         sprmparam = sccmd.Parameters.Add("@passportNo", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.PassportNo;
         sprmparam = sccmd.Parameters.Add("@passportExpiryDate", SqlDbType.DateTime);
         sprmparam.Value = employeeinfo.PassportExpiryDate;
         sprmparam = sccmd.Parameters.Add("@labourCardNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.LabourCardNumber;
         sprmparam = sccmd.Parameters.Add("@labourCardExpiryDate", SqlDbType.DateTime);
         sprmparam.Value = employeeinfo.LabourCardExpiryDate;
         sprmparam = sccmd.Parameters.Add("@visaNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.VisaNumber;
         sprmparam = sccmd.Parameters.Add("@visaExpiryDate", SqlDbType.DateTime);
         sprmparam.Value = employeeinfo.VisaExpiryDate;
         sprmparam = sccmd.Parameters.Add("@salaryType", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.SalaryType;
         sprmparam = sccmd.Parameters.Add("@dailyWage", SqlDbType.Decimal);
         sprmparam.Value = employeeinfo.DailyWage;
         sprmparam = sccmd.Parameters.Add("@bankName", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.BankName;
         sprmparam = sccmd.Parameters.Add("@branchName", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.BranchName;
         sprmparam = sccmd.Parameters.Add("@bankAccountNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.BankAccountNumber;
         sprmparam = sccmd.Parameters.Add("@branchCode", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.BranchCode;
         sprmparam = sccmd.Parameters.Add("@panNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.PanNumber;
         sprmparam = sccmd.Parameters.Add("@pfNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.PfNumber;
         sprmparam = sccmd.Parameters.Add("@esiNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.EsiNumber;
         sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = employeeinfo.ExtraDate;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Extra2;
         sprmparam = sccmd.Parameters.Add("@defaultPackageId", SqlDbType.Decimal);
         sprmparam.Value = employeeinfo.DefaultPackageId;
         int inAffectedRows = sccmd.ExecuteNonQuery();
         if (inAffectedRows > 0)
         {
             isEdit = true;
         }
         else
         {
             isEdit = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
     return isEdit;
 }
        /// <summary>
        /// Function to insert values to Employee Table and returns last identity
        /// </summary>
        /// <param name="employeeinfo"></param>
        /// <returns></returns>
        public decimal EmployeeAddWithReturnIdentity(EmployeeInfo employeeinfo)
        {
            decimal decEmployee = -1;
            try
            {
                if (sqlcon.State == ConnectionState.Closed)
                {
                    sqlcon.Open();
                }
                SqlCommand sccmd = new SqlCommand("EmployeeForTakingEmployeeId", sqlcon);
                sccmd.CommandType = CommandType.StoredProcedure;
                SqlParameter sprmparam = new SqlParameter();

                sprmparam = sccmd.Parameters.Add("@designationId", SqlDbType.Decimal);
                sprmparam.Value = employeeinfo.DesignationId;
                sprmparam = sccmd.Parameters.Add("@employeeName", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.EmployeeName;
                sprmparam = sccmd.Parameters.Add("@employeeCode", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.EmployeeCode;
                sprmparam = sccmd.Parameters.Add("@dob", SqlDbType.DateTime);
                sprmparam.Value = employeeinfo.Dob;
                sprmparam = sccmd.Parameters.Add("@maritalStatus", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.MaritalStatus;
                sprmparam = sccmd.Parameters.Add("@gender", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.Gender;
                sprmparam = sccmd.Parameters.Add("@qualification", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.Qualification;
                sprmparam = sccmd.Parameters.Add("@address", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.Address;
                sprmparam = sccmd.Parameters.Add("@phoneNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.PhoneNumber;
                sprmparam = sccmd.Parameters.Add("@mobileNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.MobileNumber;
                sprmparam = sccmd.Parameters.Add("@email", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.Email;
                sprmparam = sccmd.Parameters.Add("@joiningDate", SqlDbType.DateTime);
                sprmparam.Value = employeeinfo.JoiningDate;
                sprmparam = sccmd.Parameters.Add("@terminationDate", SqlDbType.DateTime);
                sprmparam.Value = employeeinfo.TerminationDate;
                sprmparam = sccmd.Parameters.Add("@active", SqlDbType.Bit);
                sprmparam.Value = employeeinfo.IsActive;
                sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.Narration;
                sprmparam = sccmd.Parameters.Add("@bloodGroup", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.BloodGroup;
                sprmparam = sccmd.Parameters.Add("@passportNo", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.PassportNo;
                sprmparam = sccmd.Parameters.Add("@passportExpiryDate", SqlDbType.DateTime);
                sprmparam.Value = employeeinfo.PassportExpiryDate;
                sprmparam = sccmd.Parameters.Add("@labourCardNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.LabourCardNumber;
                sprmparam = sccmd.Parameters.Add("@labourCardExpiryDate", SqlDbType.DateTime);
                sprmparam.Value = employeeinfo.LabourCardExpiryDate;
                sprmparam = sccmd.Parameters.Add("@visaNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.VisaNumber;
                sprmparam = sccmd.Parameters.Add("@visaExpiryDate", SqlDbType.DateTime);
                sprmparam.Value = employeeinfo.VisaExpiryDate;
                sprmparam = sccmd.Parameters.Add("@salaryType", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.SalaryType;
                sprmparam = sccmd.Parameters.Add("@dailyWage", SqlDbType.Decimal);
                sprmparam.Value = employeeinfo.DailyWage;
                sprmparam = sccmd.Parameters.Add("@bankName", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.BankName;
                sprmparam = sccmd.Parameters.Add("@branchName", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.BranchName;
                sprmparam = sccmd.Parameters.Add("@bankAccountNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.BankAccountNumber;
                sprmparam = sccmd.Parameters.Add("@branchCode", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.BranchCode;
                sprmparam = sccmd.Parameters.Add("@panNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.PanNumber;
                sprmparam = sccmd.Parameters.Add("@pfNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.PfNumber;
                sprmparam = sccmd.Parameters.Add("@esiNumber", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.EsiNumber;

                sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.Extra1;
                sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
                sprmparam.Value = employeeinfo.Extra2;
                sprmparam = sccmd.Parameters.Add("@defaultPackageId", SqlDbType.Decimal);
                sprmparam.Value = employeeinfo.DefaultPackageId;
                object AdvancePaymentId = sccmd.ExecuteScalar();
                if (AdvancePaymentId != null)
                {
                    decEmployee = Convert.ToDecimal(AdvancePaymentId.ToString());
                }
                else
                {
                    decEmployee = -1;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
            finally
            {
                sqlcon.Close();
            }
            return decEmployee;
        }
 /// <summary>
 /// Function to get particular values from employee table based on the parameter
 /// </summary>
 /// <param name="employeeId"></param>
 /// <returns></returns>
 public EmployeeInfo SalesmanViewSpecificFeilds(decimal employeeId)
 {
     EmployeeInfo infoemployee = new EmployeeInfo();
     SqlDataReader sqldr = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sqlcmd = new SqlCommand("SalesmanViewSpecificFeilds", sqlcon);
         sqlcmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sqlcmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
         sprmparam.Value = employeeId;
         sqldr = sqlcmd.ExecuteReader();
         while (sqldr.Read())
         {
             infoemployee.EmployeeId = Convert.ToDecimal(sqldr["employeeId"].ToString());
             infoemployee.EmployeeName = sqldr["employeeName"].ToString();
             infoemployee.EmployeeCode = sqldr["employeeCode"].ToString();
             infoemployee.Email = sqldr["email"].ToString();
             infoemployee.PhoneNumber = sqldr["phoneNumber"].ToString();
             infoemployee.MobileNumber = sqldr["mobileNumber"].ToString();
             infoemployee.Address = sqldr["address"].ToString();
             infoemployee.Narration = sqldr["narration"].ToString();
             infoemployee.IsActive = Convert.ToBoolean(sqldr["isActive"].ToString());
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqldr.Close();
         sqlcon.Close();
     }
     return infoemployee;
 }
 /// <summary>
 /// Function to Update values in employee Table for salesman
 /// </summary>
 /// <param name="employeeinfo"></param>
 /// <returns></returns>
 public bool SalesmanEdit(EmployeeInfo employeeinfo)
 {
     bool isEdit = false;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("SalesmanEdit", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@employeeId", SqlDbType.Decimal);
         sprmparam.Value = employeeinfo.EmployeeId;
         sprmparam = sccmd.Parameters.Add("@employeeName", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.EmployeeName;
         sprmparam = sccmd.Parameters.Add("@employeeCode", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.EmployeeCode;
         sprmparam = sccmd.Parameters.Add("@address", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Address;
         sprmparam = sccmd.Parameters.Add("@phoneNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.PhoneNumber;
         sprmparam = sccmd.Parameters.Add("@mobileNumber", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.MobileNumber;
         sprmparam = sccmd.Parameters.Add("@email", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Email;
         sprmparam = sccmd.Parameters.Add("@isActive", SqlDbType.Bit);
         sprmparam.Value = employeeinfo.IsActive;
         sprmparam = sccmd.Parameters.Add("@narration", SqlDbType.VarChar);
         sprmparam.Value = employeeinfo.Narration;
         int inAffectedRows = sccmd.ExecuteNonQuery();
         if (inAffectedRows > 0)
         {
             isEdit = true;
         }
         else
         {
             isEdit = false;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
     return isEdit;
 }
 /// <summary>
 /// Function to view details for update based on parameter
 /// </summary>
 /// <param name="decBonusDeductionId"></param>
 /// <returns></returns>
 public BonusDedutionInfo BonusDeductionViewForUpdate(decimal decBonusDeductionId)
 {
     BonusDedutionInfo BonusDeductionInfo = new BonusDedutionInfo();
     EmployeeInfo InfoEmployee = new EmployeeInfo();
     SqlDataReader sqldr = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sqlcmd = new SqlCommand("BonusDeductionViewForUpdate", sqlcon);
         sqlcmd.CommandType = CommandType.StoredProcedure;
         sqlcmd.Parameters.Add("@bonusDeductionId", SqlDbType.Decimal).Value = decBonusDeductionId;
         sqldr = sqlcmd.ExecuteReader();
         while (sqldr.Read())
         {
             BonusDeductionInfo.EmployeeId = decimal.Parse(sqldr["employeeId"].ToString());
             BonusDeductionInfo.Date = DateTime.Parse(sqldr["date"].ToString());
             BonusDeductionInfo.Month = DateTime.Parse(sqldr["month"].ToString());
             BonusDeductionInfo.BonusAmount = decimal.Parse(sqldr["bonusAmount"].ToString());
             BonusDeductionInfo.DeductionAmount = decimal.Parse(sqldr["deductionAmount"].ToString());
             BonusDeductionInfo.Narration = sqldr["narration"].ToString();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqldr.Close();
         sqlcon.Close();
     }
     return BonusDeductionInfo;
 }