/// <summary> /// Refreshes sunrise and sunset based on latittude and longitude found in the configuration file. /// </summary> /// <param name="configBuilder">config builder for the AutoDarkModeConfig to allow saving</param> private static void UpdateSunTime(AdmConfigBuilder configBuilder) { int[] sun = SunDate.CalculateSunriseSunset(configBuilder.LocationData.Lat, configBuilder.LocationData.Lon); configBuilder.LocationData.Sunrise = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, sun[0] / 60, sun[0] - (sun[0] / 60) * 60, 0); configBuilder.LocationData.Sunset = new DateTime(DateTime.Now.Year, DateTime.Now.Month, DateTime.Now.Day, sun[1] / 60, sun[1] - (sun[1] / 60) * 60, 0); Logger.Info($"new sunrise ({configBuilder.LocationData.Sunrise.ToString("HH:mm")}) and new sunset ({configBuilder.LocationData.Sunset.ToString("HH:mm")})"); }
public bool?CheckNightModeConditions() { if (NightMode == NightMode.Scheduled && RequestedTheme == ElementTheme.Light) { TimeSpan start; TimeSpan end; if (IsLocationBased && Location.Latitude != 0 && Location.Longitude != 0) { var t = SunDate.CalculateSunriseSunset(Location.Latitude, Location.Longitude); start = new TimeSpan(t[1] / 60, t[1] - (t[1] / 60) * 60, 0); end = new TimeSpan(t[0] / 60, t[0] - (t[0] / 60) * 60, 0); } else { start = start.Add(From); end = end.Add(To); } var now = DateTime.Now.TimeOfDay; // see if start comes before end if (start < end) { return(start <= now && now <= end); } // start is after end, so do the inverse comparison return(!(end < now && now < start)); } return(null); }
public void UpdateTimer() { if (NightMode == NightMode.Scheduled && RequestedTheme == ElementTheme.Light) { var start = DateTime.Today; var end = DateTime.Today; if (IsLocationBased && Location.Latitude != 0 && Location.Longitude != 0) { var t = SunDate.CalculateSunriseSunset(Location.Latitude, Location.Longitude); var sunrise = new TimeSpan(t[0] / 60, t[0] - (t[0] / 60) * 60, 0); var sunset = new TimeSpan(t[1] / 60, t[1] - (t[1] / 60) * 60, 0); start = start.Add(sunset); end = end.Add(sunrise); if (sunrise > DateTime.Now.TimeOfDay) { start = start.AddDays(-1); } else if (sunrise < sunset) { end = end.AddDays(1); } } else { start = start.Add(From); end = end.Add(To); if (From < DateTime.Now.TimeOfDay) { start = start.AddDays(-1); } else if (To < From) { end = end.AddDays(1); } } var now = DateTime.Now; if (now < start) { _nightModeTimer.Change(start - now, TimeSpan.Zero); } else if (now < end) { _nightModeTimer.Change(end - now, TimeSpan.Zero); } else { _nightModeTimer.Change(Timeout.Infinite, Timeout.Infinite); } } else { _nightModeTimer.Change(Timeout.Infinite, Timeout.Infinite); } }
private string ConvertSunDate(bool enabled, Location location) { if (location == null || (location.Latitude == 0 && location.Longitude == 0) || !enabled) { return(null); } var t = SunDate.CalculateSunriseSunset(location.Latitude, location.Longitude); var sunrise = new DateTime(1, 1, 1, t[0] / 60, t[0] - (t[0] / 60) * 60, 0); var sunset = new DateTime(1, 1, 1, t[1] / 60, t[1] - (t[1] / 60) * 60, 0); return(string.Format(Strings.Resources.AutoNightUpdateLocationInfo, BindConvert.Current.ShortTime.Format(sunset), BindConvert.Current.ShortTime.Format(sunrise))); }
public bool?CheckNightModeConditions() { if (NightMode == NightMode.Scheduled && RequestedTheme == ElementTheme.Light) { var start = DateTime.Now.Date; var end = DateTime.Now.Date; if (IsLocationBased && Location.Latitude != 0 && Location.Longitude != 0) { var t = SunDate.CalculateSunriseSunset(Location.Latitude, Location.Longitude); var sunrise = new TimeSpan(t[0] / 60, t[0] - (t[0] / 60) * 60, 0); var sunset = new TimeSpan(t[1] / 60, t[1] - (t[1] / 60) * 60, 0); start = start.Add(sunset); end = end.Add(sunrise); if (sunrise > DateTime.Now.TimeOfDay) { start = start.AddDays(-1); } else if (sunrise < sunset) { end = end.AddDays(1); } } else { start = start.Add(From); end = end.Add(To); if (From < DateTime.Now.TimeOfDay) { start = start.AddDays(-1); } else if (To < From) { end = end.AddDays(1); } } var now = DateTime.Now; if (now >= start && now < end) { return(true); } } return(null); }
private string ConvertSunDate(bool enabled, Location location) { if (location == null || (location.Latitude == 0 && location.Longitude == 0) || !enabled) { return(null); } var start = DateTime.Today; var end = DateTime.Today; var t = SunDate.CalculateSunriseSunset(location.Latitude, location.Longitude); var sunrise = new TimeSpan(t[0] / 60, t[0] - (t[0] / 60 * 60), 0); var sunset = new TimeSpan(t[1] / 60, t[1] - (t[1] / 60 * 60), 0); start = start.Add(sunset); end = end.Add(sunrise); return(string.Format(Strings.Resources.AutoNightUpdateLocationInfo, Converter.ShortTime.Format(start), Converter.ShortTime.Format(end))); }
public string GetFootInformation() { string dtr = ""; string username = "******"; Persia.SunDate persiandate = new SunDate(); persiandate = Persia.Calendar.ConvertToPersian(DateTime.Now); //lbldate.Text = persiandate.Weekday; //string dt = FormatDateTime( if (Session["username"] != null) { username = Session["username"].ToString(); } dtr = "امروز <b>" + (persiandate.Weekday) + "</b>" + " <span id=\"digitalclock\">111111</span> " + "کاربر جاری : <b>" + username + "</b> <a class=\"exit\" href=\"exit.aspx\"> ( خروج ) </a>"; return dtr; }
public void GetListOfWorkers(string EmployeeID) { //_sListofWorkers = ""; string _sGetListofWorkers = ""; _sListofWorkers1 = ""; conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString); try { if (conn.State == System.Data.ConnectionState.Closed) { conn.Open(); //_sGetListofWorkers = " select distinct (select user_ID from ovms_employees where employee_id = ed.employee_id) as User_ID, " + // " (select email_id from ovms_users where user_ID = (select user_ID from ovms_employees where employee_id = ed.employee_id)) as User_Email, " + // " (select user_password from ovms_users where user_ID = (select user_ID from ovms_employees where employee_id = ed.employee_id)) as User_Password, " + // " e.employee_id,dbo.CamelCase(ed.first_name) as first_name,dbo.CamelCase(ed.last_name) as last_name,ed.pay_rate from ovms_timesheet_status as ts " + // " join ovms_timesheet_details as td on ts.timesheet_status_id = td.timesheet_status_id " + // " join ovms_timesheet as t on td.timesheet_id = t.timesheet_id " + // " join ovms_employees as e on t.employee_id = e.employee_id " + // " join ovms_employee_details as ed on e.employee_id = ed.employee_id " + // " and e.active = 1 " + // " and t.active = 1 "; _sGetListofWorkers = " select distinct (select user_ID from ovms_employees where employee_id = ed.employee_id) as User_ID, e.job_id, " + " (select email_id from ovms_users where user_ID = (select user_ID from ovms_employees where employee_id = ed.employee_id)) as User_Email, " + " (select user_password from ovms_users where user_ID = (select user_ID from ovms_employees where employee_id = ed.employee_id)) as User_Password, " + " e.employee_id,dbo.CamelCase(ed.first_name) as first_name,dbo.CamelCase(ed.last_name) as last_name,ed.pay_rate, " + " (select user_id as Manager_ID from ovms_jobs where job_id = e.job_id and active = 1) as Manager_ID " + " from ovms_timesheet_status as ts " + " join ovms_timesheet_details as td on ts.timesheet_status_id = td.timesheet_status_id " + " join ovms_timesheet as t on td.timesheet_id = t.timesheet_id join ovms_employees as e " + " on t.employee_id = e.employee_id join ovms_employee_details as ed " + " on e.employee_id = ed.employee_id " + " and e.active = 1 " + " and t.active = 1 " + " and td.active = 1 " + " and(select user_id as Manager_ID from ovms_jobs where job_id = e.job_id and active = 1) = " + Session["UserID"].ToString() + ""; _sGetListofWorkers = _sGetListofWorkers + " and td.active = 1 order by first_name asc "; SqlCommand cmdGetListofWorkers = new SqlCommand(_sGetListofWorkers, conn); SqlDataReader rsGetListOfWorker = cmdGetListofWorkers.ExecuteReader(); _sTimeSheetLines = ""; while (rsGetListOfWorker.Read()) { if (EmployeeID != "") { if (rsGetListOfWorker["employee_ID"].ToString() == EmployeeID) { Session["sFullNameClient"] = rsGetListOfWorker["first_name"].ToString() + " " + rsGetListOfWorker["last_name"].ToString(); Session["EmailClient"] = rsGetListOfWorker["User_Email"].ToString(); Session["P@ssClient"] = rsGetListOfWorker["User_Password"].ToString(); Session["UserIDClient"] = rsGetListOfWorker["User_ID"].ToString(); _sTimeSheetLines = "<tr><td>" + " <a class='btn btn-primary' href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + rsGetListOfWorker["employee_id"] + "'><i class='icon-user-1'></i> " + rsGetListOfWorker["first_name"].ToString() + " " + rsGetListOfWorker["last_name"].ToString() + "</a>" + " </td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " </tr>"; //Do details Session["EmployeeIDForJob"] = EmployeeID; //pull person information //GetListOfWorkers(Request["TID"]); NumberOfWeeks = GetNumberOfWeeks(); FirstMonday = GetMonday(NumberOfWeeks.Split(',')[0].ToString()); FirstSunday = GetSunday(NumberOfWeeks.Split(',')[0].ToString()); ContractWeeks = NumberOfWeeks.Split(',')[2].ToString(); //week num LastContractDate = NumberOfWeeks.Split(',')[1].ToString(); //last contract date GetEmployeeID(); //draw table but first read from file int counter = 0; string line; string TimeSheet_Line = ""; string TimeSheetFileRead = ""; int iloop = 0; DateTime MonDate; DateTime SunDate; string _sMonday; string _sMondayDay = ""; string _sMondayMonth = ""; string _sMondayYear = ""; string _sTuesday; string _sWednesday; string _sThursday; string _sFriday; string _sSaturday; string _sSunday; string enableordisable = ""; string _sBackground = ""; double _dTotal = 0; //get all time values for this timesheet conn = new SqlConnection(WebConfigurationManager.ConnectionStrings["dbconn"].ConnectionString); try { if (conn.State == System.Data.ConnectionState.Closed) { conn.Open(); // Session["JobID"] = jobID.ToString(); //start, end and weeks //string sqlGetTime = "select concat(month,-day, -year) as tDate, hours " + // " from ovms_timesheet where employee_id = " + Session["EmployeeIDForJob"].ToString(); string sqlGetTime = "select concat(a.month,-a.day, -a.year) as tDate, a.hours, b.timesheet_status_id, " + " (select timesheet_status from ovms_timesheet_status where timesheet_status_id = b.timesheet_status_id and active = 1) as TimeSheet_Status_Name " + " from ovms_timesheet a, ovms_timesheet_details b " + " where a.employee_id = " + Session["EmployeeIDForJob"].ToString() + " " + " and a.timesheet_id = b.timesheet_id " + " and a.active = 1 " + " and b.active = 1 "; SqlCommand cmdGetTime = new SqlCommand(sqlGetTime, conn); SqlDataReader rsGetTime = cmdGetTime.ExecuteReader(); //string _svendorList = ""; while (rsGetTime.Read()) { //Session["EmployeeIDForJob"] = rsGetTime["employee_ID"].ToString(); //_sArrayString = rsStartEndWeeks["contract_Start_date"].ToString() + "," + rsStartEndWeeks["contract_end_date"].ToString() + "," + rsStartEndWeeks["Num_weeks"].ToString(); //sTimeValues = sTimeValues + rsGetTime["tDate"].ToString() + "," + rsGetTime["hours"].ToString() + "@"; sTimeValues = sTimeValues + rsGetTime["tDate"].ToString() + "," + rsGetTime["hours"].ToString() + "," + rsGetTime["TimeSheet_Status_Name"].ToString() + "@"; } rsGetTime.Close(); cmdGetTime.Dispose(); } } catch (Exception ex) { // } finally { if (conn.State == System.Data.ConnectionState.Open) { conn.Close(); } } for (iloop = 0; iloop <= Convert.ToInt32(ContractWeeks); iloop++) { if (iloop == 0) { MonDate = Convert.ToDateTime(FirstMonday); SunDate = Convert.ToDateTime(FirstSunday); } else { MonDate = AddWorkingDays(Convert.ToDateTime(FirstMonday), iloop * 5); SunDate = AddWorkingDays(Convert.ToDateTime(FirstSunday), iloop * 5); //MonDate = Convert.ToDateTime(FirstMonday),AddDays(iloop * 7 + 1); } //Monday if (Convert.ToDateTime(MonDate).Day.ToString().Length == 1) { _sMonday = "0" + Convert.ToDateTime(MonDate).Day.ToString(); _sMondayDay = Convert.ToDateTime(MonDate).Day.ToString(); _sMondayMonth = Convert.ToDateTime(MonDate).Month.ToString(); _sMondayYear = Convert.ToDateTime(MonDate).Year.ToString(); } else { _sMonday = Convert.ToDateTime(MonDate).Day.ToString(); } //Tuesday if (Convert.ToDateTime(MonDate).AddDays(1).Day.ToString().Length == 1) { _sTuesday = "0" + Convert.ToDateTime(MonDate).AddDays(1).Day.ToString(); } else { _sTuesday = Convert.ToDateTime(MonDate).AddDays(1).Day.ToString(); } //Wednesday if (Convert.ToDateTime(MonDate).AddDays(2).Day.ToString().Length == 1) { _sWednesday = "0" + Convert.ToDateTime(MonDate).AddDays(1).Day.ToString(); } else { _sWednesday = Convert.ToDateTime(MonDate).AddDays(2).Day.ToString(); } //Thursday if (Convert.ToDateTime(MonDate).AddDays(3).Day.ToString().Length == 1) { _sThursday = "0" + Convert.ToDateTime(MonDate).AddDays(3).Day.ToString(); } else { _sThursday = Convert.ToDateTime(MonDate).AddDays(3).Day.ToString(); } //Friday if (Convert.ToDateTime(MonDate).AddDays(4).Day.ToString().Length == 1) { _sFriday = "0" + Convert.ToDateTime(MonDate).AddDays(4).Day.ToString(); } else { _sFriday = Convert.ToDateTime(MonDate).AddDays(4).Day.ToString(); } //Saturday if (Convert.ToDateTime(MonDate).AddDays(5).Day.ToString().Length == 1) { _sSaturday = "0" + Convert.ToDateTime(MonDate).AddDays(5).Day.ToString(); } else { _sSaturday = Convert.ToDateTime(MonDate).AddDays(5).Day.ToString(); } //Sunday if (Convert.ToDateTime(MonDate).AddDays(6).Day.ToString().Length == 1) { _sSunday = "0" + Convert.ToDateTime(MonDate).AddDays(6).Day.ToString(); } else { _sSunday = Convert.ToDateTime(MonDate).AddDays(6).Day.ToString(); } if (iloop % 2 >= 1) { enableordisable = ""; _sBackground = "bgcolor='#ECF0F1'"; } else { enableordisable = "disabled"; _sBackground = ""; } //load all values from database for this employeeID _dTotal = Convert.ToDouble(CheckValTime(MonDate.AddDays(0).Day.ToString(), MonDate.AddDays(0).Month.ToString(), MonDate.AddDays(0).Year.ToString()).Split(',')[0].ToString()) + Convert.ToDouble(CheckValTime(MonDate.AddDays(1).Day.ToString(), MonDate.AddDays(1).Month.ToString(), MonDate.AddDays(1).Year.ToString()).Split(',')[0].ToString()) + Convert.ToDouble(CheckValTime(MonDate.AddDays(2).Day.ToString(), MonDate.AddDays(2).Month.ToString(), MonDate.AddDays(2).Year.ToString()).Split(',')[0].ToString()) + Convert.ToDouble(CheckValTime(MonDate.AddDays(3).Day.ToString(), MonDate.AddDays(3).Month.ToString(), MonDate.AddDays(3).Year.ToString()).Split(',')[0].ToString()) + Convert.ToDouble(CheckValTime(MonDate.AddDays(4).Day.ToString(), MonDate.AddDays(4).Month.ToString(), MonDate.AddDays(4).Year.ToString()).Split(',')[0].ToString()) + Convert.ToDouble(CheckValTime(MonDate.AddDays(5).Day.ToString(), MonDate.AddDays(5).Month.ToString(), MonDate.AddDays(5).Year.ToString()).Split(',')[0].ToString()) + Convert.ToDouble(CheckValTime(MonDate.AddDays(6).Day.ToString(), MonDate.AddDays(6).Month.ToString(), MonDate.AddDays(6).Year.ToString()).Split(',')[0].ToString()); if (_dTotal > 0) { _sTimeSheetLines = _sTimeSheetLines + "<tr " + _sBackground + ">" + " <td>" + Session["sFullNameClient"].ToString() + "</td>" + " <td>" + Convert.ToInt32(iloop + 1) + "</td>" + " <td>" + DateTime.Parse(MonDate.ToString()).ToString("dd MMM, yyyy") + "</td>" + " <td>" + DateTime.Parse(SunDate.ToString()).ToString("dd MMM, yyyy") + "</td>" + " <td>" + " <div class='input-group'>" + " " + CheckValTime(MonDate.AddDays(0).Day.ToString(), MonDate.AddDays(0).Month.ToString(), MonDate.AddDays(0).Year.ToString()).Split(',')[0].ToString() + " </div>" + " </td>" + " <td>" + " <div class='input-group'>" + " " + CheckValTime(MonDate.AddDays(1).Day.ToString(), MonDate.AddDays(1).Month.ToString(), MonDate.AddDays(1).Year.ToString()).Split(',')[0].ToString() + " </div>" + " </td>" + " <td>" + " <div class='input-group'>" + " " + CheckValTime(MonDate.AddDays(2).Day.ToString(), MonDate.AddDays(2).Month.ToString(), MonDate.AddDays(2).Year.ToString()).Split(',')[0].ToString() + " </div>" + " </td>" + " <td>" + " <div class='input-group'>" + " " + CheckValTime(MonDate.AddDays(3).Day.ToString(), MonDate.AddDays(3).Month.ToString(), MonDate.AddDays(3).Year.ToString()).Split(',')[0].ToString() + " </div>" + " </td>" + " <td>" + " <div class='input-group'>" + " " + CheckValTime(MonDate.AddDays(4).Day.ToString(), MonDate.AddDays(4).Month.ToString(), MonDate.AddDays(4).Year.ToString()).Split(',')[0].ToString() + " </div>" + " </td>" + " <td>" + " <div class='input-group'>" + " " + CheckValTime(MonDate.AddDays(5).Day.ToString(), MonDate.AddDays(5).Month.ToString(), MonDate.AddDays(5).Year.ToString()).Split(',')[0].ToString() + " </div>" + " </td>" + " <td>" + " <div class='input-group'>" + " " + CheckValTime(MonDate.AddDays(6).Day.ToString(), MonDate.AddDays(6).Month.ToString(), MonDate.AddDays(6).Year.ToString()).Split(',')[0].ToString() + " </div>" + " </td>"; _sTimeSheetLines = _sTimeSheetLines + "<td>" + _dTotal + " </td>"; //_sTimeSheetLines = _sTimeSheetLines + "<td><a href='Client_View_Worker.aspx?wopen=Y&p=VW&done=' class='btn btn-success btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Request for an Interview or Approve candidate'><i class='fa fa-check'></i></a> <a href='Client_View_Worker.aspx?wopen=Y&p=VW&more=' class='btn btn-default btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Request more details'><i class='fa fa-pencil'></i></a> <a href='Client_View_Worker.aspx?wopen=Y&p=VW&Reject=' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject Candidate'><i class='fa fa-times'></i></a></td>"; //_sTimeSheetLines = _sTimeSheetLines + "<td>" + CheckValTime(MonDate.AddDays(0).Day.ToString(), MonDate.AddDays(0).Month.ToString(), MonDate.AddDays(0).Year.ToString()).Split(',')[1].ToString() + " </td>"; string sAction = CheckValTime(MonDate.AddDays(0).Day.ToString(), MonDate.AddDays(0).Month.ToString(), MonDate.AddDays(0).Year.ToString()).Split(',')[1].ToString(); if (sAction == "Pending Review") { // _sTimeSheetLines = _sTimeSheetLines + "<td><a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID="+Request.QueryString["TID"].ToString()+ "&action=Approve&fromD="+ MonDate.AddDays(0).Day.ToString() +"&FromM="+ MonDate.AddDays(0).Month.ToString() +"&FromY="+ MonDate.AddDays(0).Year.ToString() + "' class='btn btn-success btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Approve TimeSheet'><i class='fa fa-check'></i></a> <a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + Request.QueryString["TID"].ToString() + "&action=Reject&fromD=" + MonDate.AddDays(0).Day.ToString() + "&FromM=" + MonDate.AddDays(0).Month.ToString() + "&FromY=" + MonDate.AddDays(0).Year.ToString() + "' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject TimeSheet'><i class='fa fa-times'></i></a></td>"; _sTimeSheetLines = _sTimeSheetLines + "<td><a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + Request.QueryString["TID"].ToString() + "&action=Approve&fromD=" + MonDate.AddDays(0).Day.ToString() + "&FromM=" + MonDate.AddDays(0).Month.ToString() + "&FromY=" + MonDate.AddDays(0).Year.ToString() + "' class='btn btn-success btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Approve TimeSheet'><i class='fa fa-check'></i></a> <a href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + Request.QueryString["TID"].ToString() + "&action=Reject&fromD=" + MonDate.AddDays(0).Day.ToString() + "&FromM=" + MonDate.AddDays(0).Month.ToString() + "&FromY=" + MonDate.AddDays(0).Year.ToString() + "' class='btn btn-danger btn-xs' data-toggle='tooltip' data-placement='top' name='abc' title='Reject TimeSheet'><i class='fa fa-times'></i></a></td>"; } else { _sTimeSheetLines = _sTimeSheetLines + "<td>" + CheckValTime(MonDate.AddDays(0).Day.ToString(), MonDate.AddDays(0).Month.ToString(), MonDate.AddDays(0).Year.ToString()).Split(',')[1].ToString() + " </td>"; } _sTimeSheetLines = _sTimeSheetLines + "</tr>"; } } } else { _sListofWorkers1 = _sListofWorkers1 + " <tr>" + " <td>" + " <a class='btn btn-primary' href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + rsGetListOfWorker["employee_id"] + "'><i class='icon-user-1'></i> " + rsGetListOfWorker["first_name"].ToString() + " " + rsGetListOfWorker["last_name"].ToString() + "</a>" + " </td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " </tr>"; } //lblTimeSheet.Text = _sTimeSheetLines; } if (EmployeeID == "") { _sListofWorkers = _sListofWorkers + " <tr>" + " <td>" + " <a class='btn btn-primary' href='C_TimeSheet_View.aspx?topen=Y&p=VT&TID=" + rsGetListOfWorker["employee_id"] + "'><i class='icon-user-1'></i> " + rsGetListOfWorker["first_name"].ToString() + " " + rsGetListOfWorker["last_name"].ToString() + "</a>" + " </td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " <td></td>" + " </tr>"; } } rsGetListOfWorker.Close(); cmdGetListofWorkers.Dispose(); } } catch (Exception ex) { // } finally { if (conn.State == System.Data.ConnectionState.Open) { conn.Close(); } } if (EmployeeID == "") //first load { lblNames.Text = _sListofWorkers; } //second and other loads if (EmployeeID != "") { lblNames.Text = _sTimeSheetLines + "</tr><tr></tr>" + _sListofWorkers1; } }