Пример #1
0
    private void LoadData()
    {
        string sAction = Request.QueryString["action"].ToString();
        int    nID     = Convert.ToInt32(Request.QueryString["nid"]);

        Delivery_Invoice obj = new Delivery_Invoice();
        DataTable        dtb = new DataTable();

        dtb                    = obj.getByID(nID);
        lblStaffID.Text        = dtb.Rows[0]["StaffID"].ToString();
        ddlStaff.SelectedValue = dtb.Rows[0]["StaffID"].ToString();
        lblDate.Text           = dtb.Rows[0]["Date"].ToString();
        int nInvoiceDetailID = Convert.ToInt32(dtb.Rows[0]["InvoiceDetailsID"]);

        lblIInoiveDetails.Text = nInvoiceDetailID.ToString();

        InvoiceDetails objDetails = new InvoiceDetails();

        dtb = objDetails.getByID(nInvoiceDetailID);
        string sInvoiceID = dtb.Rows[0]["InvoiceID"].ToString();

        Invoice objInvoice = new Invoice();

        dtb = objInvoice.getMultipleID(sInvoiceID);
        rptProducts.DataSource = dtb;
        rptProducts.DataBind();
    }
    private void BindataToRpt()
    {
        Delivery_Invoice obj = new Delivery_Invoice();

        rptDelivery.DataSource = obj.getAll();
        rptDelivery.DataBind();
    }
    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;
            }
        }
    }
Пример #4
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 !");
        }
    }
Пример #5
0
    private void LoadData()
    {
        string sFrom = Request.QueryString["datefrom"].ToString();
        string sTo   = Request.QueryString["dateto"].ToString();

        lblDateFrom.Text = sFrom;
        lblDateTo.Text   = sTo;
        Delivery_Invoice obj = new Delivery_Invoice();
        DataTable        dtb = new DataTable();

        dtb = obj.ReportbyDate(sFrom, sTo);
        rptReportOrder.DataSource = dtb;
        rptReportOrder.DataBind();
    }
    private void LoadData()
    {
        int nID = Convert.ToInt32(Request.QueryString["nid"]);

        Delivery_Invoice obj = new Delivery_Invoice();
        DataTable        dtb = new DataTable();

        dtb               = obj.getByIDInvoiceDetails(nID);
        lblStaff.Text     = dtb.Rows[0]["Staff_Name"].ToString();
        lblDate.Text      = dtb.Rows[0]["Date"].ToString();
        lblCodeOrder.Text = "OD-" + nID;
        string  sInvoiceID = dtb.Rows[0]["InvoiceID"].ToString();
        Invoice objInvoice = new Invoice();

        dtb = objInvoice.getMultipleID(sInvoiceID);
        rptProducts.DataSource = dtb;
        rptProducts.DataBind();
    }
    protected void rptAdministrator_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string           strCommand = e.CommandName;
        int              nID        = Convert.ToInt32(e.CommandArgument);
        Delivery_Invoice obj        = new Delivery_Invoice();

        switch (strCommand)
        {
        case "Delete":

            int nDelete = obj.delete(nID);
            this.BindataToRpt();
            break;

        case "Edit":
            string sEdit = "~/Admin/Administrator.aspx?page=deliveryedit&action=edit&nid=" + nID;
            Response.Redirect(sEdit);
            break;
        }
    }