コード例 #1
0
    protected void hlEdit_Click(object sender, EventArgs e)
    {
        RepeaterItem item = (sender as Button).Parent as RepeaterItem;

        Int64 Id = int.Parse((item.FindControl("lblId") as Label).Text);

        employeewagesMaster objemp = new Cls_employeewages_b().SelectById(Id);

        if (objemp != null)
        {
            lstCustomer.SelectedValue = objemp.eid.ToString();
            hfcustomer.Value          = objemp.eid.ToString();
            txtfirstcount.Text        = objemp.firstcount.ToString();
            txtfirstrate.Text         = objemp.firstrate.ToString();
            txtsecondrate.Text        = objemp.secondrate.ToString();
            txtvshaperate.Text        = objemp.vshaperate.ToString();
            txtsilairate.Text         = objemp.silairate.ToString();
            txtcurrentfirstrate.Text  = objemp.currentfirstrate.ToString();
            txtcurrentsecondrate.Text = objemp.currentsecondrate.ToString();
            txtcurrentvshaperate.Text = objemp.currentvshaperate.ToString();
            txtcurrentsilairate.Text  = objemp.currentsilairate.ToString();
            txt_Date.Text             = objemp.createddate;
        }
        update               = true;
        Session["update"]    = true;
        Session["id"]        = Id;
        btnSave.Text         = "Update";
        spnMessage.InnerText = "";
    }
コード例 #2
0
    private void BindWages()
    {
        try
        {
            Cls_employeewages_b clsEmployee     = new Cls_employeewages_b();
            DataTable           dtEmployeeWages = clsEmployee.SelectAll();

            if (dtEmployeeWages != null)
            {
                if (dtEmployeeWages.Rows.Count > 0)
                {
                    repCategory.DataSource = dtEmployeeWages;
                    repCategory.DataBind();
                }
                else
                {
                    repCategory.DataSource = null;
                    repCategory.DataBind();
                }
            }
            else
            {
                repCategory.DataSource = null;
                repCategory.DataBind();
            }
        }
        catch { }
        finally { con.Close(); }
    }