protected void ClearAll() { try { int IntEmpId = 0; if (ViewState["LoginUserGroup"].ToString() == "EMP") { IntEmpId = int.Parse(ViewState["LoginId"].ToString()); DDLEmplName.Enabled = false; DDLEmpView.Enabled = false; } else { DDLEmplName.Enabled = true; DDLEmpView.Enabled = true; } DDLEmpView.Items.Clear(); DDLEmpView.DataSource = BLayer.FillEmp(IntEmpId, ""); DDLEmpView.DataValueField = "EmpId"; DDLEmpView.DataTextField = "EmpName"; DDLEmpView.DataBind(); if (IntEmpId == 0) { DDLEmpView.Items.Insert(0, new ListItem("--Select Employee--", "0")); } DDLEmplName.Items.Clear(); DDLEmplName.DataSource = BLayer.FillEmp(IntEmpId, ""); DDLEmplName.DataValueField = "EmpId"; DDLEmplName.DataTextField = "EmpName"; DDLEmplName.DataBind(); if (IntEmpId == 0) { DDLEmplName.Items.Insert(0, new ListItem("--Select Employee--", "0")); } LblMsg.Text = ""; HidFldId.Value = ""; TxtDRFDate.Text = ""; TxtInTime.Text = ""; TxtOutTime.Text = ""; TxtTotWrkHours.Text = ""; TxtRemark.Text = ""; GridWork.DataSource = null; GridWork.DataBind(); TxtTotTime.Text = ""; } catch (Exception ex) { Response.Write(ex.ToString()); } }
protected void ClearAll() { try { int IntEmpId = 0; if (ViewState["LoginUserGroup"].ToString() == "EMP") { IntEmpId = int.Parse(ViewState["LoginId"].ToString()); ddlEmployee.Enabled = false; DDLEmpView.Enabled = false; } else { ddlEmployee.Enabled = true; DDLEmpView.Enabled = true; } DDLEmpView.Items.Clear(); DDLEmpView.DataSource = BLayer.FillEmp(IntEmpId, ""); DDLEmpView.DataValueField = "EmpId"; DDLEmpView.DataTextField = "EmpName"; DDLEmpView.DataBind(); if (IntEmpId == 0) { DDLEmpView.Items.Insert(0, new ListItem("--Select Employee--", "0")); } ddlEmployee.Items.Clear(); ddlEmployee.DataSource = BLayer.FillEmp(IntEmpId, ""); ddlEmployee.DataValueField = "EmpId"; ddlEmployee.DataTextField = "EmpName"; ddlEmployee.DataBind(); if (IntEmpId == 0) { ddlEmployee.Items.Insert(0, new ListItem("--Select Employee--", "0")); } LblMsg.Text = ""; HidFldId.Value = ""; TxtOffFTime.Text = ""; TxtOffTTime.Text = ""; TxtOffHours.Text = ""; TxtDays.Text = ""; TxtMonth.Text = ""; TxtInTime.Text = ""; TxtOutTime.Text = ""; TxtTotWrkHours.Text = ""; TxtOverTime.Text = ""; TxtLessTime.Text = ""; TxtReason.Text = ""; TxtRemark.Text = ""; TxtDate.Text = DateTime.Today.ToString("dd/MM/yyyy"); GetDayMonth(); } catch (Exception ex) { Response.Write(ex.ToString()); } }