本文整理汇总了C#中Attendance.BAL.Report.GetFinalPayrollDate方法的典型用法代码示例。如果您正苦于以下问题:C# Report.GetFinalPayrollDate方法的具体用法?C# Report.GetFinalPayrollDate怎么用?C# Report.GetFinalPayrollDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attendance.BAL.Report
的用法示例。
在下文中一共展示了Report.GetFinalPayrollDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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();
GetShifts(lblLocation.Text.ToString());
ddlShift.SelectedIndex = ddlShift.Items.IndexOf(ddlShift.Items.FindByValue(Session["ShiftID"].ToString()));
DateTime TodayDate = Convert.ToDateTime(Session["TodayBannerDate"]);
getLocations();
ddlLocation.SelectedIndex = ddlLocation.Items.IndexOf(ddlLocation.Items.FindByText(lblLocation.Text.Trim()));
if (Session["IsAdmin"].ToString() == "True")
{
ddlLocation.Enabled = true;
}
else
{
ddlLocation.Enabled = false;
}
Report obj = new Report();
DataSet ds=obj.GetFinalPayrollDate(Convert.ToInt32(ddlLocation.SelectedItem.Value));
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
DateTime StartDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["FinalMonth"].ToString()+ "/01/" + ds.Tables[0].Rows[0]["FinalYear"].ToString());
ViewState["PaidStartDate"] = StartDate.ToString("MM/dd/yyyy");
ViewState["CurrentStDt"] = StartDate.ToString("MM/dd/yyyy");
DateTime EndDate = StartDate.AddMonths(1).AddSeconds(-1);
ViewState["PaidEndDate"] = EndDate.ToString("MM/dd/yyyy");
ViewState["CurrentEndDt"] = EndDate.ToString("MM/dd/yyyy");
GetpaidLeavesData(Convert.ToInt32(ddlLocation.SelectedItem.Value), StartDate, EndDate,Convert.ToInt32(ddlShift.SelectedValue));
if (StartDate.ToString("MM/dd/yyyy") == Convert.ToDateTime(ViewState["CurrentStDt"]).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;
}
}
else
{
lblNodata.Visible = true;
dvlblNodata.Style["display"] = "block";
lblNodata.Text = "No data found";
lblTotal.Text = "";
grdUsers.DataSource = null;
grdUsers.DataBind();
}
}
else
{
lblNodata.Visible = true;
dvlblNodata.Style["display"] = "block";
lblNodata.Text = "No data found";
lblTotal.Text = "";
grdUsers.DataSource = null;
grdUsers.DataBind();
}
}
}
else
{
Response.Redirect("Default.aspx");
}
}
示例2: ddlShift_SelectedIndexChanged
protected void ddlShift_SelectedIndexChanged(object sender, EventArgs e)
{
try
{
if (ViewState["PaidStartDate"] == null)
{
Report obj = new Report();
DataSet ds = obj.GetFinalPayrollDate(Convert.ToInt32(ddlLocation.SelectedItem.Value));
if (ds.Tables.Count > 0)
{
if (ds.Tables[0].Rows.Count > 0)
{
DateTime StartDate = Convert.ToDateTime(ds.Tables[0].Rows[0]["FinalMonth"].ToString() + "/01/" + ds.Tables[0].Rows[0]["FinalYear"].ToString());
ViewState["PaidStartDate"] = StartDate.ToString("MM/dd/yyyy");
ViewState["CurrentStDt"] = StartDate.ToString("MM/dd/yyyy");
DateTime EndDate = StartDate.AddMonths(1).AddSeconds(-1);
ViewState["PaidEndDate"] = EndDate.ToString("MM/dd/yyyy");
ViewState["CurrentEndDt"] = EndDate.ToString("MM/dd/yyyy");
GetpaidLeavesData(Convert.ToInt32(ddlLocation.SelectedItem.Value), StartDate, EndDate, Convert.ToInt32(ddlShift.SelectedValue));
if (StartDate.ToString("MM/dd/yyyy") == Convert.ToDateTime(ViewState["CurrentStDt"]).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;
}
}
}
}
else
{
DateTime StartDate = Convert.ToDateTime(ViewState["PaidStartDate"]);
DateTime EndDate = Convert.ToDateTime(ViewState["PaidEndDate"]);
GetpaidLeavesData(Convert.ToInt32(ddlLocation.SelectedItem.Value), StartDate, EndDate, Convert.ToInt32(ddlShift.SelectedValue));
}
}
catch (Exception ex)
{
}
}