Example:
bal_Attendance obj = new bal_Attendance(); //public//
button()
{
obj.branch_id = int.Parse(ddlbranch.SelectedItem.Value);
obj.date = dt.ToShortDateString();
obj.attendance = status.ToString();
obj.employee_id = int.Parse(e_id.Text);
obj.employeename = e_name.Text;
}