protected void Page_Load(object sender, EventArgs e) { LDT = LAdapter.Select_sum_Eid(Convert.ToInt32(Session["eid"].ToString())); if (LDT.Rows[0]["Days"].ToString() != "") { lblleave.Text = LDT.Rows[0]["Days"].ToString(); LDT = LAdapter.Select_Sum_Eid_status(Convert.ToInt32(Session["eid"].ToString()), "Approve"); if (LDT.Rows[0]["Days"].ToString() != "") { lblaleave.Text = LDT.Rows[0]["Days"].ToString(); } LDT = LAdapter.Select_Sum_Eid_status(Convert.ToInt32(Session["eid"].ToString()), "Cancel"); if (LDT.Rows[0]["Days"].ToString() != "") { lblcleave.Text = LDT.Rows[0]["Days"].ToString(); } } SDT = SAdapter.Select_Salary_HOME(Session["acno"].ToString()); if (SDT.Rows.Count != 0) { lblsalary.Text = SDT.Rows[0]["NetPay"].ToString(); lblasal.Text = SDT.Rows[0]["allowance"].ToString(); lbldsal.Text = SDT.Rows[0]["deducation"].ToString(); } }
protected void btnselect_Click(object sender, EventArgs e) { EDT = EAdapter.Select_By_EID(Convert.ToInt32(drpemp.SelectedValue)); lblbpay.Text = EDT.Rows[0]["BasicPay"].ToString(); lblsalary.Text = EDT.Rows[0]["salary"].ToString(); ViewState["eid"] = EDT.Rows[0]["eid"].ToString(); ViewState["bpay"] = EDT.Rows[0]["BasicPay"].ToString(); lblname.Text = EDT.Rows[0]["ename"].ToString(); lblacno.Text = EDT.Rows[0]["bankacno"].ToString(); ClsDT = ClsAdapter.SELECT_BY_CLASS(EDT.Rows[0]["class"].ToString()); txttall.Text = ClsDT.Rows[0]["TravelAllowance"].ToString(); txtmall.Text = ClsDT.Rows[0]["MedicalAllowance"].ToString(); txtwall.Text = ClsDT.Rows[0]["WashingAllowance"].ToString(); LSDT = LSAdapter.Select_Sum_EID_month(Convert.ToInt32(ViewState["eid"].ToString()), drpmonth.SelectedItem.Text); lblleave.Text = LSDT.Rows[0]["days"].ToString(); if (lblleave.Text != "") { // lblleave.Text ="0"; LSDT = LSAdapter.Select_sum_eid_moth_status(Convert.ToInt32(ViewState["eid"].ToString()), drpmonth.SelectedItem.Text, "Approve"); lblleaveapprove.Text = LSDT.Rows[0]["days"].ToString(); if (lblleaveapprove.Text != "") { double salary = Convert.ToDouble(lblsalary.Text); double onedaysalary = salary / 30; int totlaleavededuction = Convert.ToInt32(lblleaveapprove.Text) * Convert.ToInt32(onedaysalary); lblleavededuc.Text = totlaleavededuction.ToString(); } else { //lblleave.Text = "0"; lblleavededuc.Text = "0"; lblleaveapprove.Text = "0"; } } else { lblleave.Text = "0"; lblleavededuc.Text = "0"; lblleaveapprove.Text = "0"; } MultiView1.ActiveViewIndex = 0; txtda.Focus(); // LDT=LAdapter.Select_By_LID // lblbpay.Text = EDT.Rows[0]["BasicPay"].ToString(); //lblbpay.Text = EDT.Rows[0]["BasicPay"].ToString(); }