Exemplo n.º 1
0
    protected void btnsubmitfet_Click(object sender, EventArgs e)
    {
        nszillow.clsprpfet    obj    = new nszillow.clsprpfet();
        nszillow.clsprpfetprp objprp = new nszillow.clsprpfetprp();
        if (btnsubmitfet.Text == "Submit")
        {
            objprp.prpfetprpcod = Convert.ToInt32(ViewState["cod"]);
            objprp.prpfetfetcod = Convert.ToInt32(drpdwnlstfet.SelectedValue);
            objprp.prpfetdsc    = txtboxfetdsc.Text;

            obj.Save_Rec(objprp);

            txtboxfetdsc.Text = String.Empty;
            grdbind();
        }
        else if (btnsubmitfet.Text == "Update")
        {
            objprp.prpfetcod    = Convert.ToInt32(grdviewfet.DataKeys[grdviewfet.EditIndex].Values[0]);
            objprp.prpfetdsc    = txtboxfetdsc.Text;
            objprp.prpfetfetcod = Convert.ToInt32(drpdwnlstfet.SelectedValue);
            obj.Update_Rec(objprp);
            txtboxfetdsc.Text    = String.Empty;
            btnsubmitfet.Text    = "Submit";
            grdviewfet.EditIndex = -1;
            grdbind();
        }
    }
Exemplo n.º 2
0
 protected void grdviewfet_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     nszillow.clsprpfet    obj    = new nszillow.clsprpfet();
     nszillow.clsprpfetprp objprp = new nszillow.clsprpfetprp();
     objprp.prpfetcod = Convert.ToInt32(grdviewfet.DataKeys[e.RowIndex].Value);
     obj.Delete_Rec(objprp);
     grdbind();
 }