예제 #1
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (rdoadmin.Checked == true)
     {
         ADT = AAdapter.Select_For_Login(txtuname.Text, txtpass.Text);
         if (ADT.Rows.Count > 0)
         {
             Session["admin"] = ADT.Rows[0]["username"].ToString();
             Session["apass"] = ADT.Rows[0]["password"].ToString();
             Session["aid"]   = ADT.Rows[0]["aid"].ToString();
             Response.Redirect("Main.aspx");
         }
         else
         {
             lbl.Text = "Invalid Detail";
         }
     }
     else
     {
         EDT = EAdapter.Select_Login(txtuname.Text, txtpass.Text);
         if (EDT.Rows.Count > 0)
         {
             Session["ename"] = EDT.Rows[0]["ename"].ToString();
             Session["eid"]   = EDT.Rows[0]["eid"].ToString();
             Session["epass"] = EDT.Rows[0]["password"].ToString();
             Session["acno"]  = EDT.Rows[0]["bankacno"].ToString();
             Response.Redirect("Emp/MyAccount.aspx");
         }
         else
         {
             lbl.Text = "Invalid Detail";
         }
     }
 }
예제 #2
0
    protected void btngeneratesalary_Click(object sender, EventArgs e)
    {
        double tdeducation = Convert.ToDouble(lblleavededuc.Text) + Convert.ToDouble(lblda.Text) + Convert.ToDouble(lblhr.Text);

        double tallowance = Convert.ToDouble(txtmall.Text) + Convert.ToDouble(txtwall.Text) + Convert.ToDouble(txttall.Text);

        double netsalary = (Convert.ToDouble(lblsalary.Text) + tallowance) - tdeducation;

        SAdapter.Insert(drpemp.SelectedItem.Text, lblacno.Text, drpclass.SelectedItem.Text, Convert.ToDouble(lblbpay.Text), Convert.ToDouble(lblsalary.Text), Convert.ToDouble(txttall.Text), Convert.ToDouble(txtmall.Text), Convert.ToDouble(txtwall.Text), Convert.ToInt32(lblleaveapprove.Text), Convert.ToDouble(lblleavededuc.Text), Convert.ToDouble(lblda.Text), Convert.ToDouble(lblhr.Text), tdeducation, tallowance, netsalary, drpmonth.SelectedItem.Text, Convert.ToInt32(txtyear.Text));

        txtda.Text = "";
        txthr.Text = "";
        lblda.Text = "";
        lblhr.Text = "";

        MultiView1.ActiveViewIndex = -1;
        // lbl.Text = "Salary Generated Successfully";

        drpclass.Focus();
        EDT = EAdapter.Select_For_Salary(drpclass.SelectedItem.Text, drpmonth.Text, Convert.ToInt32(txtyear.Text));
        drpemp.DataSource     = EDT;
        drpemp.DataTextField  = "Ename";
        drpemp.DataValueField = "EID";
        drpemp.DataBind();
        drpemp.Items.Insert(0, "SELECT");
    }
예제 #3
0
    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();
    }
예제 #4
0
 protected void drpclass_SelectedIndexChanged(object sender, EventArgs e)
 {
     EDT = EAdapter.Select_For_Salary(drpclass.SelectedItem.Text, drpmonth.Text, Convert.ToInt32(txtyear.Text));
     drpemp.DataSource     = EDT;
     drpemp.DataTextField  = "Ename";
     drpemp.DataValueField = "EID";
     drpemp.DataBind();
     drpemp.Items.Insert(0, "SELECT");
 }
예제 #5
0
 protected void drpclass_SelectedIndexChanged(object sender, EventArgs e)
 {
     EDT = EAdapter.Select_For_Year_Report(drpclass.SelectedItem.Text, Convert.ToInt32(txtyear.Text));
     drpemp.DataSource     = EDT;
     drpemp.DataTextField  = "Ename";
     drpemp.DataValueField = "BankAcno";
     drpemp.DataBind();
     drpemp.Items.Insert(0, "SELECT");
     drpemp.Items.Insert(1, "ALL");
 }
 protected void drpbranch_SelectedIndexChanged(object sender, EventArgs e)
 {
     drpemployee.Items.Clear();
     EDT = EAdapter.Select_By_Branch(drpbranch.SelectedItem.Text);
     drpemployee.DataSource     = EDT;
     drpemployee.DataTextField  = "Ename";
     drpemployee.DataValueField = "EID";
     drpemployee.DataBind();
     drpemployee.Items.Insert(0, "SELECT");
     MultiView1.ActiveViewIndex = -1;
 }
 protected void btnsearch_Click(object sender, EventArgs e)
 {
     // try
     // {
     EDT = EAdapter.Select_By_EID(Convert.ToInt32(drpemployee.SelectedValue));
     if (EDT.Rows.Count > 0)
     {
         ViewState["eid"]           = EDT.Rows[0]["eid"].ToString();
         lblname.Text               = EDT.Rows[0]["Ename"].ToString();
         lbladd.Text                = EDT.Rows[0]["add"].ToString();
         lblcity.Text               = EDT.Rows[0]["city"].ToString();
         lblpincode.Text            = EDT.Rows[0]["pincode"].ToString();
         lblmobile.Text             = EDT.Rows[0]["mobile"].ToString();
         lbldegree.Text             = EDT.Rows[0]["degree"].ToString();
         lbldesign.Text             = EDT.Rows[0]["designation"].ToString();
         lblbranch.Text             = EDT.Rows[0]["branch"].ToString();
         lblclass.Text              = EDT.Rows[0]["class"].ToString();
         lblbasicpay.Text           = EDT.Rows[0]["basicpay"].ToString();
         lblsalary.Text             = EDT.Rows[0]["salary"].ToString();
         lblbankaco.Text            = EDT.Rows[0]["bankacno"].ToString();
         lblemail.Text              = EDT.Rows[0]["email"].ToString();
         lblpass.Text               = EDT.Rows[0]["password"].ToString();
         lblstatus.Text             = EDT.Rows[0]["status"].ToString();
         MultiView1.ActiveViewIndex = 0;
         if (EDT.Rows[0]["status"].ToString() == "Active")
         {
             btnstatus.Text = "InActive";
         }
         else
         {
             btnstatus.Text = "Active";
         }
     }
     else
     {
         lbl.Text = "Error !!";
         MultiView1.ActiveViewIndex = -1;
     }
     // }
     // catch
     // {
     //     lbl.Text = "Error !!";
     // }
 }
예제 #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        EDT         = EAdapter.select();
        lblemp.Text = EDT.Rows.Count.ToString();

        EDT          = EAdapter.Select_By_Status("Active");
        lblaemp.Text = EDT.Rows.Count.ToString();

        EDT          = EAdapter.Select_By_Status("InActive");
        lbldemp.Text = EDT.Rows.Count.ToString();

        LDT            = LAdapter.Seelct_By_Status("New");
        lblnleave.Text = LDT.Rows.Count.ToString();

        LDT            = LAdapter.Seelct_By_Status("Approve");
        lblaleave.Text = LDT.Rows.Count.ToString();

        LDT            = LAdapter.Seelct_By_Status("Cancel");
        lblrleave.Text = LDT.Rows.Count.ToString();
    }
예제 #9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     EDT = EAdapter.select();
 }