protected void ddlStatus_SelectedIndexChanged(object sender, EventArgs e)
    {
        int            nStatus = Convert.ToInt32(ddlStatus.SelectedValue);
        int            nID     = Convert.ToInt32(Request.QueryString["nid"]);
        InvoiceDetails obj     = new InvoiceDetails();
        int            nRes    = obj.updateStatus(nID, nStatus);
        string         sDate   = DateTime.Now.Month + "/" + DateTime.Now.Day + "/" + DateTime.Now.Year;
        int            nStaff  = Convert.ToInt32(ddlStaff.SelectedValue);

        if (nRes > 0)
        {
            switch (nStatus)
            {
            case 0:
                MessageBoxss.Show("Update successful !");
                break;

            case 1:
                Delivery_Invoice objDelivery = new Delivery_Invoice();
                objDelivery.insert(nStaff, sDate, nID, 0);
                MessageBoxss.Show("Add successful delivery bill !");

                break;

            case 2:
                MessageBoxss.Show("Update successful !");
                break;
            }
        }
    }
Beispiel #2
0
    protected void btUpdate_Click(object sender, EventArgs e)
    {
        Delivery_Invoice obj = new Delivery_Invoice();

        int nID      = Convert.ToInt32(Request.QueryString["nid"]);
        int nStaffID = Convert.ToInt32(ddlStaff.SelectedValue);
        int nStatus  = Convert.ToInt32(ddlStatus.SelectedValue);

        if (obj.updateStatus(nID, nStaffID, nStatus) > 0)
        {
            MessageBoxss.Show("Update successful !");
        }
    }