本文整理汇总了C#中Attendance.BAL.Report.GetFreezedDate方法的典型用法代码示例。如果您正苦于以下问题:C# Report.GetFreezedDate方法的具体用法?C# Report.GetFreezedDate怎么用?C# Report.GetFreezedDate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attendance.BAL.Report
的用法示例。
在下文中一共展示了Report.GetFreezedDate方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ddlReportType_SelectedIndexChanged
//.........这里部分代码省略.........
}
if (ddlReportType.SelectedItem.Value == "1")
{
DateTime todayDate = Convert.ToDateTime(Session["TodayDate1"]);
// DateTime startOfMonth = new DateTime(todayDate.Year, todayDate.Month, 1);
DateTime startDate = GeneralFunction.GetFirstDayOfWeekDate(todayDate);
DateTime StartDate = startDate.AddDays(-21);
ViewState["TodayDate1"] = StartDate;
ViewState["CurrentWeek"] = StartDate;
hdnWeeklyStartDt.Value = StartDate.ToString();
DateTime endDate = startDate.AddDays(6);
ViewState["CrntWkEnd"] = endDate;
DataTable dt = GetWeeklyReport(StartDate, endDate);
btnFreeze.Visible = false;
lblFreeze.Visible = false;
if (GeneralFunction.GetFirstDayOfWeekDate(endDate).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
if (dt.Rows.Count > 0)
{
grdAttandence.DataSource = null;
grdAttandence.DataBind();
grdWeeklyAttendance.DataSource = dt;
grdWeeklyAttendance.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
}
}
if (ddlReportType.SelectedItem.Value == "0")
{
DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartDate = GeneralFunction.GetFirstDayOfWeekDate(TodayDate);
DateTime EndDate = GeneralFunction.GetLastDayOfWeekDate(TodayDate);
if (GeneralFunction.GetFirstDayOfWeekDate(TodayDate).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
btnFreeze.Visible = true;
lblFreeze.Visible = true;
// DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartOfMonth = StartDate.AddDays(-1);
DateTime FreezeDate = StartOfMonth;
Attendance.BAL.Report obj = new Report();
// int CNT = obj.GetFreezedDate(FreezeDate);
DateTime CNT = obj.GetFreezedDate(FreezeDate, ddlLocation.SelectedItem.Text.ToString().Trim());
lblFreezedate.Text = FreezeDate.ToString("MM/dd/yyyy");
hdnFreeze.Value = FreezeDate.ToString("MM/dd/yyyy");
if (CNT.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "Attendance freezed until " + CNT.ToString("MM/dd/yyyy");
ViewState["FreezeDate"] = CNT.ToString("MM/dd/yyyy");
btnFreeze.CssClass = "btn btn-warning btn-small disabled";
btnFreeze.Enabled = false;
}
else
{
lblFreeze.Visible = false;
btnFreeze.CssClass = "btn btn-warning btn-small enabled";
btnFreeze.Enabled = true;
}
DataTable ds = GetReportAdmin(StartDate, EndDate, Convert.ToInt32(ddlLocation.SelectedValue));
Session["AtnAdminDetails"] = ds;
grdAttandence.DataSource = ds;
grdAttandence.DataBind();
grdWeeklyAttendance.DataSource = null;
grdWeeklyAttendance.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
}
}
catch (Exception ex)
{
}
}
示例2: btnPrevious_Click
protected void btnPrevious_Click(object sender, EventArgs e)
{
try
{
if (ddlReportType.SelectedItem.Value == "0")
{
int userid = Convert.ToInt32(Session["UserID"]);
DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime PrevWeek = TodayDate.AddDays(-7);
Session["TodayDate"] = PrevWeek.ToString();
if (GeneralFunction.GetFirstDayOfWeekDate(PrevWeek).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
DateTime PreWeekStart = GeneralFunction.GetFirstDayOfWeekDate(PrevWeek);
DateTime PreWeekEnd = GeneralFunction.GetLastDayOfWeekDate(PrevWeek);
//DataTable ds = GetReport(PreWeekStart, PreWeekEnd, userid);
string Ismanage = Session["IsManage"].ToString();
string IsAdmin = Session["IsAdmin"].ToString();
DataTable ds = new DataTable();
if (Ismanage == "False")
{
ds = GetReportSingle(PreWeekStart, PreWeekEnd, userid);
Session["AtnDetails"] = ds;
if (ds.Rows.Count > 0)
{
grdAttandence.DataSource = null;
grdAttandence.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
grdAttendanceSingle.DataSource = ds;
grdAttendanceSingle.DataBind();
lnkUserMangement.ForeColor = System.Drawing.Color.Gray;
lnkUserMangement.Enabled = false;
ddlLocation.Visible = false;
lblGrdLocaton.Visible = false;
lnkPayroll.ForeColor = System.Drawing.Color.Gray;
lnkPayroll.Enabled = false;
// lnkUserMangement.Style["display"] = "none";
}
}
else
{
btnFreeze.Visible = true;
lblFreeze.Visible = true;
// DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartOfMonth = PreWeekStart.AddDays(-1);
DateTime FreezeDate = StartOfMonth;
Attendance.BAL.Report obj = new Report();
// int CNT = obj.GetFreezedDate(FreezeDate);
DateTime CNT = obj.GetFreezedDate(FreezeDate, Session["LocationName"].ToString().Trim());
lblFreezedate.Text = FreezeDate.ToString("MM/dd/yyyy");
hdnFreeze.Value = FreezeDate.ToString("MM/dd/yyyy");
if (CNT.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "Attendance freezed until " + CNT.ToString("MM/dd/yyyy");
ViewState["FreezeDate"] = CNT.ToString("MM/dd/yyyy");
btnFreeze.CssClass = "btn btn-warning btn-small disabled";
btnFreeze.Enabled = false;
}
else
{
lblFreeze.Visible = false;
btnFreeze.CssClass = "btn btn-warning btn-small enabled";
btnFreeze.Enabled = true;
}
ds = GetReport(PreWeekStart, PreWeekEnd, userid);
Session["AtnDetails"] = ds;
grdAttandence.DataSource = ds;
grdAttandence.DataBind();
grdAttendanceSingle.DataSource = null;
grdAttendanceSingle.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
}
}
else if (ddlReportType.SelectedItem.Value == "1")
{
btnFreeze.Visible = false;
lblFreeze.Visible = false;
int userid = Convert.ToInt32(Session["UserID"]);
DateTime todayDate = Convert.ToDateTime(ViewState["TodayDate1"]);
ViewState["TodayDate1"] = todayDate.AddDays(-28);
// DateTime startOfMonth = new DateTime(todayDate.Year, todayDate.Month, 1);
DateTime startDate = GeneralFunction.GetFirstDayOfWeekDate(todayDate.AddDays(-28));
DateTime StartDate = startDate;
hdnWeeklyStartDt.Value = StartDate.ToString();
//.........这里部分代码省略.........
示例3: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["TodayBannerDate"] != null)
{
comanyname.Text = CommonFiles.ComapnyName;
if (!IsPostBack)
{
string timezone = "";
if (Convert.ToInt32(Session["TimeZoneID"]) == 2)
{
timezone = "Eastern Standard Time";
}
else
{
timezone = "India Standard Time";
}
DateTime ISTTime = TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById(timezone));
var CurentDatetime = ISTTime;
lblDate2.Text = CurentDatetime.ToString("dddd MMMM dd yyyy, hh:mm:ss tt ");
hdnTodaydt.Value = CurentDatetime.ToString("MM/dd/yyyy");
lblTimeZoneName.Text = Session["TimeZoneName"].ToString().Trim();
lblLocation.Text = Session["LocationName"].ToString();
lblHeadSchedule.Text = Session["ScheduleInOut"].ToString();
getLocations();
ViewState["Location"] = Session["LocationName"].ToString();
ddlLocation.SelectedIndex = ddlLocation.Items.IndexOf(ddlLocation.Items.FindByText(lblLocation.Text.Trim()));
lblEmployyName.Text = Session["EmpName"].ToString().Trim();
Photo.Src = Session["Photo"].ToString().Trim();
Session["TodayDate"] = Session["TodayBannerDate"];
DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
Session["TodayDate1"] = Convert.ToDateTime(Session["TodayDate"]);
if (GeneralFunction.GetFirstDayOfWeekDate(TodayDate).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
DateTime StartDate = GeneralFunction.GetFirstDayOfWeekDate(TodayDate);
DateTime EndDate = GeneralFunction.GetLastDayOfWeekDate(TodayDate);
ViewState["CurrentStart"] = StartDate;
ViewState["CurrentEnd"] = EndDate;
int userid = Convert.ToInt32(Session["UserID"]);
string Ismanage = Session["IsManage"].ToString();
string IsAdmin = Session["IsAdmin"].ToString();
btnFreeze.Visible = true;
lblFreeze.Visible = true;
// DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartOfMonth = StartDate.AddDays(-1);
DateTime FreezeDate = StartOfMonth;
lblFreezedate.Text = FreezeDate.ToString("MM/dd/yyyy");
hdnFreeze.Value = FreezeDate.ToString("MM/dd/yyyy");
Attendance.BAL.Report obj = new Report();
//int CNT = obj.GetFreezedDate(FreezeDate);
DateTime CNT = obj.GetFreezedDate(FreezeDate, ddlLocation.SelectedItem.Text.ToString().Trim());
lblFreezedate.Text = FreezeDate.ToString("MM/dd/yyyy");
hdnFreeze.Value = FreezeDate.ToString("MM/dd/yyyy");
if (CNT.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "Attendance freezed until " + CNT.ToString("MM/dd/yyyy");
ViewState["FreezeDate"] = CNT.ToString("MM/dd/yyyy");
btnFreeze.CssClass = "btn btn-warning btn-small disabled";
btnFreeze.Enabled = false;
}
else
{
lblFreeze.Visible = false;
btnFreeze.CssClass = "btn btn-warning btn-small enabled";
btnFreeze.Enabled = true;
}
DataTable ds = new DataTable();
ds = GetReportAdmin(StartDate, EndDate, Convert.ToInt32(ddlLocation.SelectedValue));
lblGrdLocaton.Visible = true;
ddlLocation.Visible = true;
Session["AtnAdminDetails"] = ds;
if (ds.Rows.Count > 0)
{
grdAttandence.DataSource = ds;
grdAttandence.DataBind();
}
}
}
else
{
//.........这里部分代码省略.........
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["LocationName"] != null)
{
if (!IsPostBack)
{
comanyname.Text = CommonFiles.ComapnyName;
string timezone = "";
if (Convert.ToInt32(Session["TimeZoneID"]) == 2)
{
timezone = "Eastern Standard Time";
}
else
{
timezone = "India Standard Time";
}
DateTime ISTTime = TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById(timezone));
var CurentDatetime = ISTTime;
lblDate2.Text = CurentDatetime.ToString("dddd MMMM dd yyyy, hh:mm:ss tt ");
lblTimeZoneName.Text = Session["TimeZoneName"].ToString().Trim();
lblHeadSchedule.Text = Session["ScheduleInOut"].ToString();
lblEmployyName.Text = Session["EmpName"].ToString().Trim();
Photo.Src = Session["Photo"].ToString().Trim();
lblLocation.Text = Session["LocationName"].ToString();
DateTime TodayDate = Convert.ToDateTime(Session["TodayBannerDate"]);
DateTime StartDate = GeneralFunction.GetFirstDayOfWeekDate(TodayDate);
DateTime EndDate = StartDate.AddDays(-14);
ViewState["StartRptDt"] = EndDate;
ViewState["EndRptDt"] = StartDate.AddDays(-1);
txtToDate.Text = StartDate.AddDays(-1).ToString("MM/dd/yyyy");
txtFromDate.Text = EndDate.ToString("MM/dd/yyyy");
int userid = Convert.ToInt32(Session["UserID"]);
Attendance.BAL.Report obj = new Report();
DateTime Count = obj.GetFreezedDate(EndDate, Session["LocationName"].ToString());
if (Count.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "";
}
else
{
lblFreeze.Text = "This is tentative attendance report.Some or part of the attendance not yet freezed";
}
GetReport(EndDate, StartDate.AddDays(-1), userid);
BindListOfNewEmployee();
BindListofChanges();
}
}
else
{
Response.Redirect("Default.aspx");
}
}
示例5: btnCurrent_Click
protected void btnCurrent_Click(object sender, EventArgs e)
{
try
{
int userid = Convert.ToInt32(Session["UserID"]);
string Ismanage = Session["IsManage"].ToString();
string IsAdmin = Session["IsAdmin"].ToString();
if (ddlReportType.SelectedValue == "0")
{
DateTime StartDate = Convert.ToDateTime(ViewState["CurrentStart"].ToString());
DateTime EndDate = Convert.ToDateTime(ViewState["CurrentEnd"].ToString());
Session["TodayDate"] = StartDate;
if (GeneralFunction.GetFirstDayOfWeekDate(StartDate).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
DataTable ds = new DataTable();
lblReport.Text = "Report type";
ddlReportType.Visible = true;
lblReport.Visible = true;
btnFreeze.Visible = true;
lblFreeze.Visible = true;
DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartOfMonth = GeneralFunction.GetFirstDayOfWeekDate(TodayDate);
DateTime FreezeDate = StartOfMonth.AddDays(-1);
Attendance.BAL.Report obj = new Report();
// int CNT = obj.GetFreezedDate(FreezeDate);
DateTime CNT = obj.GetFreezedDate(FreezeDate, Session["LocationName"].ToString().Trim(), Convert.ToInt32(ddlShift.SelectedValue));
lblFreezedate.Text = FreezeDate.ToString("MM/dd/yyyy");
hdnFreeze.Value = FreezeDate.ToString("MM/dd/yyyy");
if (CNT.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "Attendance freezed until " + CNT.ToString("MM/dd/yyyy");
ViewState["FreezeDate"] = CNT.ToString("MM/dd/yyyy");
btnFreeze.CssClass = "btn btn-warning btn-small disabled";
btnFreeze.Enabled = false;
}
else
{
lblFreeze.Visible = false;
btnFreeze.CssClass = "btn btn-warning btn-small enabled";
btnFreeze.Enabled = true;
}
ds = GetReport(StartDate, EndDate, userid, Convert.ToInt32(ddlShift.SelectedItem.Value));
if (ds.Rows.Count > 1)
{
Session["AtnDetails"] = ds;
grdAttandence.DataSource = ds;
grdAttandence.DataBind();
grdWeeklyAttendance.DataSource = null;
grdWeeklyAttendance.DataBind();
dvNodata.Style["display"] = "none";
lblGrdNodata.Text = "";
}
else
{
grdAttandence.DataSource = null;
grdAttandence.DataBind();
grdWeeklyAttendance.DataSource = null;
grdWeeklyAttendance.DataBind();
dvNodata.Style["display"] = "block";
lblGrdNodata.Text = "No data found";
}
}
else if (ddlReportType.SelectedValue == "1")
{
ViewState["TodayDate1"] = ViewState["CurrentWeek"];
DateTime startWeek = Convert.ToDateTime(ViewState["CurrentWeek"]);
DateTime EndWeek = Convert.ToDateTime(ViewState["CrntWkEnd"]);
hdnWeeklyStartDt.Value = startWeek.ToString();
if (GeneralFunction.GetFirstDayOfWeekDate(EndWeek).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
lblReport.Text = "Report type";
ddlReportType.Visible = true;
lblReport.Visible = true;
//.........这里部分代码省略.........
示例6: btnGo_Click
protected void btnGo_Click(object sender, EventArgs e)
{
try
{
int userid = Convert.ToInt32(Session["UserID"]);
DateTime StartDate = Convert.ToDateTime(txtFromDate.Text);
DateTime EndTime = Convert.ToDateTime(txtToDate.Text);
ViewState["StartRptDt"] = StartDate;
ViewState["EndRptDt"] = EndTime;
Attendance.BAL.Report obj = new Report();
DateTime Count = obj.GetFreezedDate(EndTime, Session["LocationName"].ToString());
if (Count.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "";
}
else
{
lblFreeze.Text = "This is tentative attendance report.Some or part of the attendance not yet freezed";
}
GetReport(StartDate, EndTime, userid);
BindListOfNewEmployee();
BindListofChanges();
}
catch (Exception ex)
{
}
}
示例7: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
if (Session["IsAdmin"] != null && Session["UserID"] != null)
{
if (!IsPostBack)
{
comanyname.Text = CommonFiles.ComapnyName;
string timezone = "";
if (Convert.ToInt32(Session["TimeZoneID"]) == 2)
{
timezone = "Eastern Standard Time";
}
else
{
timezone = "India Standard Time";
}
DateTime ISTTime = TimeZoneInfo.ConvertTime(DateTime.UtcNow, TimeZoneInfo.FindSystemTimeZoneById(timezone));
var CurentDatetime = ISTTime;
lblDate2.Text = CurentDatetime.ToString("dddd MMMM dd yyyy, hh:mm:ss tt ");
lblTimeZoneName.Text = Session["TimeZoneName"].ToString().Trim();
lblHeadSchedule.Text = Session["ScheduleInOut"].ToString();
lblEmployyName.Text = Session["EmpName"].ToString().Trim();
Photo.Src = Session["Photo"].ToString().Trim();
lblLocation.Text = Session["LocationName"].ToString();
lblShiftName.Text = "-" + Session["ShiftName"].ToString();
DateTime TodayDate = Convert.ToDateTime(Session["TodayBannerDate"]);
int userid = Convert.ToInt32(Session["UserID"]);
getLocations();
ddlLocation.SelectedIndex = (ddlLocation.Items.IndexOf(ddlLocation.Items.FindByText(Session["LocationName"].ToString())));
ddlLocation.SelectedIndex = ddlLocation.Items.IndexOf(ddlLocation.Items.FindByText(lblLocation.Text.Trim()));
GetShifts(ddlLocation.SelectedItem.Text.ToString());
ddlShift.SelectedIndex = ddlShift.Items.IndexOf(ddlShift.Items.FindByValue(Session["ShiftID"].ToString()));
//if (lblLocation.Text.Trim() == "USMP" || lblLocation.Text.Trim() == "USWB")
//{
// lnkLeavemangement.Enabled = false;
// lnkLeavemangement.Style["Color"] = "Gray";
//}
//else
//{
// lnkLeavemangement.Enabled = true;
//}
if (Session["IsAdmin"].ToString() == "True")
{
if (ddlLocation.SelectedItem.Text.Trim() == "INBH" || ddlLocation.SelectedItem.Text.Trim() == "INDG")
{
DateTime CurrentDate = Convert.ToDateTime(ISTTime.ToString("MM/dd/yyyy"));
CurrentDate = CurrentDate.AddMonths(-1);
DateTime MonthStart = CurrentDate.AddDays(1 - CurrentDate.Day);
DateTime MonthEnd = MonthStart.AddMonths(1).AddSeconds(-1);
txtToDate.Text = MonthEnd.ToString("MM/dd/yyyy");
txtFromDate.Text = MonthStart.ToString("MM/dd/yyyy");
ViewState["StartRptDt"] = MonthStart;
ViewState["EndRptDt"] = MonthEnd;
Attendance.BAL.Report obj = new Report();
DateTime Count = obj.GetFreezedDate(MonthEnd, ddlLocation.SelectedItem.Text.Trim(),Convert.ToInt32(ddlShift.SelectedValue));
if (Count.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "";
}
else
{
lblFreeze.Text = "This is tentative attendance report.Some or part of the attendance not yet freezed";
}
//bool final = obj.GetFinalPayrollDate(MonthStart,Convert.ToInt32(ddlLocation.SelectedItem.Value),Convert.ToInt32(ddlShift.SelectedValue));
//if (final)
//{
// btnFinal.CssClass = "btn btn-small btn-warning disabled";
// btnSave.CssClass = "btn btn-small btn-warning disabled";
// btnFinal.Enabled = false;
// btnSave.Enabled = false;
// hdnFreeze.Value = "true"; ;
// // System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "delEditLabelCss();", true);
//}
//else
//{
// btnFinal.CssClass = "btn btn-small btn-warning";
// btnSave.CssClass = "btn btn-small btn-warning";
// btnFinal.Enabled = true;
// btnSave.Enabled = true;
// hdnFreeze.Value = "false";
// // System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "addEditLabelCss();", true);
//}
DataTable dt = GetReportIndia(MonthStart, MonthEnd, 0, ddlLocation.SelectedItem.Text.Trim(), Convert.ToInt32(ddlShift.SelectedValue));
lblWeekPayrollReport.Text = "( " + MonthStart.ToString("MM/dd/yyyy") + " - " + MonthEnd.ToString("MM/dd/yyyy") + " )";
GetEditHistory(MonthStart, MonthEnd);
if (dt.Rows.Count > 0)
{
lblTotal.Text = "Employee record count: " + dt.Rows.Count.ToString().Trim();
lblReportDate.Text = "Report generated at <b>" + Convert.ToDateTime(lblDate2.Text).ToString("MM/dd/yyyy hh:mm:ss tt") + "</b> by <b>" + Session["EmpName"].ToString().Trim() + "</b>";
grdPayRollIndia.DataSource = dt;
grdPayRollIndia.DataBind();
Session["Indiapayroll"] = (DataTable)grdPayRollIndia.DataSource;
grdPayRoll.DataSource = null;
//.........这里部分代码省略.........
示例8: btnGo_Click
protected void btnGo_Click(object sender, EventArgs e)
{
try
{
int userid = Convert.ToInt32(Session["UserID"]);
DateTime StartDate = Convert.ToDateTime(txtFromDate.Text);
DateTime EndTime = Convert.ToDateTime(txtToDate.Text);
ViewState["StartRptDt"] = StartDate;
ViewState["EndRptDt"] = EndTime;
Attendance.BAL.Report obj = new Report();
DateTime Count = obj.GetFreezedDate(EndTime, ddlLocation.SelectedItem.Text.ToString(), Convert.ToInt32(ddlShift.SelectedValue));
if (Count.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "";
}
else
{
lblFreeze.Text = "This is tentative attendance report.Some or part of the attendance not yet freezed";
}
if (Session["IsAdmin"].ToString() == "True")
{
if (ddlLocation.SelectedItem.Text.Trim() == "INBH" || ddlLocation.SelectedItem.Text.Trim() == "INDG")
{
txtFromDate.Text = StartDate.ToString("MM/dd/yyyy");
txtToDate.Text = EndTime.ToString("MM/dd/yyyy");
//bool final = obj.GetFinalPayrollDate(StartDate, Convert.ToInt32(ddlLocation.SelectedItem.Value), Convert.ToInt32(ddlShift.SelectedValue));
//if (final)
//{
// btnFinal.CssClass = "btn btn-small btn-warning disabled";
// btnSave.CssClass = "btn btn-small btn-warning disabled";
// btnFinal.Enabled = false;
// btnSave.Enabled = false;
// hdnFreeze.Value = "true"; ;
// // System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "delEditLabelCss();", true);
//}
//else
//{
// btnFinal.CssClass = "btn btn-small btn-warning";
// btnSave.CssClass = "btn btn-small btn-warning";
// btnFinal.Enabled = true;
// btnSave.Enabled = true;
// hdnFreeze.Value = "false";
// // System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "addEditLabelCss();", true);
//}
DataTable dt = GetReportIndia(StartDate, EndTime,0,ddlLocation.SelectedItem.Text, Convert.ToInt32(ddlShift.SelectedValue));
lblWeekPayrollReport.Text = "( " + StartDate.ToString("MM/dd/yyyy") + " - " + EndTime.ToString("MM/dd/yyyy") + " )";
GetEditHistory(StartDate, EndTime);
if (dt.Rows.Count > 0)
{
lblTotal.Text = "Employee record count: " + dt.Rows.Count.ToString().Trim();
lblReportDate.Text = "Report generated at <b>" + Convert.ToDateTime(lblDate2.Text).ToString("MM/dd/yyyy hh:mm:ss tt") + "</b> by <b>" + Session["EmpName"].ToString().Trim() + "</b>";
grdPayRollIndia.DataSource = dt;
grdPayRollIndia.DataBind();
Session["Indiapayroll"] = (DataTable)grdPayRollIndia.DataSource;
grdPayRoll.DataSource = null;
grdPayRoll.DataBind();
btnPrint.Visible = true;
lblGrdNodata.Text = "";
dvNodata.Style["display"] = "none";
}
else
{
lblTotal.Text = "";
lblReportDate.Text = "";
lblGrdNodata.Text = "No data found";
dvNodata.Style["display"] = "block";
grdPayRollIndia.DataSource = null;
grdPayRollIndia.DataBind();
grdPayRoll.DataSource = null;
grdPayRoll.DataBind();
}
}
else
{
txtFromDate.Text = StartDate.AddDays(-1).ToString("MM/dd/yyyy");
txtToDate.Text = EndTime.ToString("MM/dd/yyyy");
GetReport( StartDate.AddDays(-1),EndTime,0, ddlLocation.SelectedItem.Text.Trim(), Convert.ToInt32(ddlShift.SelectedValue));
btnPrint.Visible = false;
rppayslip.DataSource = null;
rppayslip.DataBind();
}
lblGrdLocaton.Visible = true;
ddlLocation.Visible = true;
}
else
{
GetReport(StartDate, EndTime, userid, "", Convert.ToInt32(ddlShift.SelectedValue));
lblGrdLocaton.Visible = false;
ddlLocation.Visible = false;
btnPrint.Visible = false;
rppayslip.DataSource = null;
rppayslip.DataBind();
}
// GetReport(StartDate, EndTime, userid,ddlLocation.SelectedItem.Text.Trim());
BindListOfNewEmployee();
BindListofChanges();
//.........这里部分代码省略.........
示例9: ddlShift_SelectedIndexChanged
protected void ddlShift_SelectedIndexChanged(object sender, EventArgs e)
{
ViewState["Location"] = ddlLocation.SelectedItem.Text.Trim();
try
{
if (ddlReportType.SelectedItem.Value == "0")
{
lblReport.Text = "Report type";
ddlReportType.Visible = true;
lblReport.Visible = true;
lblGrdLocaton.Visible = true;
lblGrdLocaton.Text = "Location";
ddlLocation.Visible = true;
int LocationId = Convert.ToInt32(ddlLocation.SelectedItem.Value.ToString());
DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartDate = GeneralFunction.GetFirstDayOfWeekDate(TodayDate);
DateTime EndDate = GeneralFunction.GetLastDayOfWeekDate(TodayDate);
btnFreeze.Visible = true;
lblFreeze.Visible = true;
// DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartOfMonth = StartDate.AddDays(-1);
DateTime FreezeDate = StartOfMonth;
Attendance.BAL.Report obj = new Report();
// int CNT = obj.GetFreezedDate(FreezeDate);
DateTime CNT = obj.GetFreezedDate(FreezeDate, ddlLocation.SelectedItem.Text.ToString().Trim(), Convert.ToInt32(ddlShift.SelectedValue));
lblFreezedate.Text = FreezeDate.ToString("MM/dd/yyyy");
hdnFreeze.Value = FreezeDate.ToString("MM/dd/yyyy");
if (CNT.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "Attendance freezed until " + CNT.ToString("MM/dd/yyyy");
ViewState["FreezeDate"] = CNT.ToString("MM/dd/yyyy");
btnFreeze.CssClass = "btn btn-warning btn-small disabled";
btnFreeze.Enabled = false;
}
else
{
lblFreeze.Visible = false;
btnFreeze.CssClass = "btn btn-warning btn-small enabled";
btnFreeze.Enabled = true;
}
if (GeneralFunction.GetFirstDayOfWeekDate(TodayDate).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
DataTable ds = GetReportAdmin(StartDate, EndDate, LocationId, Convert.ToInt32(ddlShift.SelectedItem.Value));
if (ds.Rows.Count > 2)
{
Session["AtnAdminDetails"] = ds;
grdAttandence.DataSource = ds;
grdAttandence.DataBind();
// System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "addCssAfterBind();", true);
grdWeeklyAttendance.DataSource = null;
grdWeeklyAttendance.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
lblGrdNodata.Text = "";
dvNodata.Style["display"] = "none";
}
else
{
dvNodata.Style["display"] = "block";
lblGrdNodata.Text = "No data found";
lblGrdNodata.Visible = true;
grdAttandence.DataSource = null;
grdAttandence.DataBind();
grdWeeklyAttendance.DataSource = null;
grdWeeklyAttendance.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
}
}
else if (ddlReportType.SelectedItem.Value == "1")
{
lblReport.Text = "Report type";
ddlReportType.Visible = true;
lblReport.Visible = true;
lblGrdLocaton.Visible = true;
lblGrdLocaton.Text = "Location";
ddlLocation.Visible = true;
btnFreeze.Visible = false;
lblFreeze.Visible = false;
int LocationId = Convert.ToInt32(ddlLocation.SelectedItem.Value.ToString());
DateTime todayDate = Convert.ToDateTime(Session["TodayDate1"]);
DateTime startDate = GeneralFunction.GetFirstDayOfWeekDate(todayDate);
DateTime StartDate = startDate.AddDays(-21);
ViewState["TodayDate1"] = StartDate;
ViewState["CurrentWeek"] = StartDate;
hdnWeeklyStartDt.Value = StartDate.ToString();
DateTime endDate = startDate.AddDays(6);
//.........这里部分代码省略.........
示例10: btnPrevious_Click
protected void btnPrevious_Click(object sender, EventArgs e)
{
try
{
if (ddlReportType.SelectedItem.Value == "0")
{
int userid = Convert.ToInt32(Session["UserID"]);
DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime PrevWeek = TodayDate.AddDays(-7);
Session["TodayDate"] = PrevWeek.ToString();
if (GeneralFunction.GetFirstDayOfWeekDate(PrevWeek).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
{
btnNext.CssClass = "btn btn-danger btn-small enabled";
btnNext.Enabled = true;
}
DateTime PreWeekStart = GeneralFunction.GetFirstDayOfWeekDate(PrevWeek);
DateTime PreWeekEnd = GeneralFunction.GetLastDayOfWeekDate(PrevWeek);
//DataTable ds = GetReport(PreWeekStart, PreWeekEnd, userid);
string Ismanage = Session["IsManage"].ToString();
string IsAdmin = Session["IsAdmin"].ToString();
DataTable ds = new DataTable();
btnFreeze.Visible = true;
lblFreeze.Visible = true;
// DateTime TodayDate = Convert.ToDateTime(Session["TodayDate"]);
DateTime StartOfMonth = PreWeekStart.AddDays(-1);
DateTime FreezeDate = StartOfMonth;
Attendance.BAL.Report obj = new Report();
// int CNT = obj.GetFreezedDate(FreezeDate);
DateTime CNT = obj.GetFreezedDate(FreezeDate, ddlLocation.SelectedItem.Text.ToString().Trim(), Convert.ToInt32(ddlShift.SelectedValue));
lblFreezedate.Text = FreezeDate.ToString("MM/dd/yyyy");
hdnFreeze.Value = FreezeDate.ToString("MM/dd/yyyy");
if (CNT.ToString("MM/dd/yyyy") != "01/01/1900")
{
lblFreeze.Text = "Attendance freezed until " + CNT.ToString("MM/dd/yyyy");
ViewState["FreezeDate"] = CNT.ToString("MM/dd/yyyy");
btnFreeze.CssClass = "btn btn-warning btn-small disabled";
btnFreeze.Enabled = false;
}
else
{
lblFreeze.Visible = false;
btnFreeze.CssClass = "btn btn-warning btn-small enabled";
btnFreeze.Enabled = true;
}
ds = GetReportAdmin(PreWeekStart, PreWeekEnd, Convert.ToInt32(ddlLocation.SelectedValue), Convert.ToInt32(ddlShift.SelectedValue));
if (ds.Rows.Count > 2)
{
Session["AtnAdminDetails"] = ds;
grdAttandence.DataSource = ds;
grdAttandence.DataBind();
//System.Web.UI.ScriptManager.RegisterClientScriptBlock(Page, typeof(Page), "Script", "addCssAfterBind();", true);
grdWeeklyAttendance.DataSource = null;
grdWeeklyAttendance.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
lblGrdNodata.Text = "";
dvNodata.Style["display"] = "none";
}
else
{
dvNodata.Style["display"] = "block";
lblGrdNodata.Text = "No data found";
lblGrdNodata.Visible = true;
grdAttandence.DataSource = null;
grdAttandence.DataBind();
grdWeeklyAttendance.DataSource = null;
grdWeeklyAttendance.DataBind();
grdMonthlyAttendance.DataSource = null;
grdMonthlyAttendance.DataBind();
}
}
else if (ddlReportType.SelectedItem.Value == "1")
{
int userid = Convert.ToInt32(Session["UserID"]);
DateTime todayDate = Convert.ToDateTime(ViewState["TodayDate1"]);
ViewState["TodayDate1"] = todayDate.AddDays(-28);
// DateTime startOfMonth = new DateTime(todayDate.Year, todayDate.Month, 1);
DateTime startDate = GeneralFunction.GetFirstDayOfWeekDate(todayDate.AddDays(-28));
DateTime StartDate = startDate;
hdnWeeklyStartDt.Value = StartDate.ToString();
DateTime endDate = todayDate.AddDays(-1);
if (GeneralFunction.GetFirstDayOfWeekDate(startDate).ToString("MM/dd/yyyy") == GeneralFunction.GetFirstDayOfWeekDate(DateTime.Now).ToString("MM/dd/yyyy"))
{
btnNext.CssClass = "btn btn-danger btn-small disabled";
btnNext.Enabled = false;
}
else
//.........这里部分代码省略.........