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(); }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { CAdapter.Delete(Convert.ToInt32(GridView1.DataKeys[e.RowIndex].Value)); CDT = CAdapter.SELECT(); GridView1.DataSource = CDT; GridView1.DataBind(); Label1.Text = "Record Deleted"; }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { CDT = CAdapter.SELECT(); GridView1.DataSource = CDT; GridView1.DataBind(); } Label1.Text = ""; }
protected void Page_Load(object sender, EventArgs e) { if (Page.IsPostBack == false) { ClsDT = ClsAdapter.SELECT(); drpclass.DataSource = ClsDT; drpclass.DataTextField = "Class"; drpclass.DataValueField = "Cid"; drpclass.DataBind(); drpclass.Items.Insert(0, "SELECT"); } }
protected void btnadd_Click(object sender, EventArgs e) { CAdapter.Insert(txtclass.Text, Convert.ToDouble(txtbpay.Text), Convert.ToDouble(txtsalary.Text), Convert.ToDouble(txttall.Text), Convert.ToDouble(txtmall.Text), Convert.ToDouble(txtwall.Text)); CDT = CAdapter.SELECT(); GridView1.DataSource = CDT; GridView1.DataBind(); txtsalary.Text = ""; txtclass.Text = ""; txtbpay.Text = ""; txttall.Text = "0"; txtwall.Text = "0"; txtmall.Text = "0"; Label1.Text = "Class Added"; }
protected void drpclass_SelectedIndexChanged(object sender, EventArgs e) { ClsDT = ClsAdapter.SELECT_by_CID(Convert.ToInt32(drpclass.SelectedValue)); txtsalary.Text = ClsDT.Rows[0]["salary"].ToString(); txtbasicpay.Text = ClsDT.Rows[0]["basicpay"].ToString(); }