Beispiel #1
0
        protected DataSet involvementSelect()
        {
            poDll.PurchaseOrder selectInv = new poDll.PurchaseOrder();
            DataSet             ds        = new DataSet();

            ds = selectInv.INVOLVEMENT_Select((string)Session["StarID"]);
            return(ds);
        }
Beispiel #2
0
        protected DataSet studentSelect()
        {
            poDll.PurchaseOrder dsStudent = new poDll.PurchaseOrder();
            DataSet             ds        = new DataSet();

            ds = dsStudent.STUDENT_Select("ab1234cd", "password");

            return(ds);
        }
Beispiel #3
0
        protected DataSet purchase()
        {
            DataSet ds = new DataSet();

            poDll.PurchaseOrder dll = new poDll.PurchaseOrder();

            ds = dll.PURCHASE_Select((string)Session["StarID"]);

            return(ds);
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        if ((string)Session["StarID"] == null)
        {
            Response.Redirect("Login.aspx");
        }

        poDll.PurchaseOrder dll = new poDll.PurchaseOrder();

        lblPoNumber.Text  = dll.PURCHASE_GetNextPoNum();
        btnSummate.Text   = "Sum Totals";
        btnSubmit.Visible = false;
    }
Beispiel #5
0
        protected void btnViewPurchase_Click(object sender, EventArgs e)
        {
            poDll.PurchaseOrder selectInv = new poDll.PurchaseOrder();
            DataSet             ds        = new DataSet();

            int poNum = Int32.Parse(dlPurchases.Text);

            ds = selectInv.PURCHASE_Select(poNum);

            GridView3.DataSource = ds;
            GridView3.DataBind();

            btnDownload.Visible = true;
        }
Beispiel #6
0
        protected void btnAddClub_Click(object sender, EventArgs e)
        {
            poDll.PurchaseOrder add = new poDll.PurchaseOrder();
            string club             = dlClubs.Text.Trim();
            int    totalRows;
            string starID = (string)Session["StarID"].ToString();

            if (starID == "")
            {
                lblAddError.Text = "Something went wrong, please logout and login then try again";
            }
            else
            {
                totalRows          = add.INVOLVEMENT_Add(starID, club);
                lblAddSuccess.Text = "Sucessfully added " + club + " to your Involvement list";
            }
        }
Beispiel #7
0
        protected void btnDownload_Click(object sender, EventArgs e)
        {
            poDll.PurchaseOrder selectInv = new poDll.PurchaseOrder();
            DataSet             ds        = new DataSet();

            int poNum = Int32.Parse(dlPurchases.Text);

            ds = selectInv.PURCHASE_Select(poNum);

            if (ds.Tables[0].Rows.Count < 1)
            {
                lblError.Text = "No results. Could not download.";
            }
            else
            {
                Download(ds);
            }
        }
Beispiel #8
0
        protected void btnRmClub_Click(object sender, EventArgs e)
        {
            poDll.PurchaseOrder add = new poDll.PurchaseOrder();
            string club             = dlClubs2.Text.Trim();
            int    totalRows;
            string starID = (string)Session["StarID"].ToString();

            if (starID == "")
            {
                lblRmError.Text = "Something went wrong, please logout and login then try again";
            }
            else
            {
                totalRows         = add.INVOLVEMENT_Remove(starID, club);
                lblRmSuccess.Text = "Sucessfully removed " + club + " from your Involvement list";
                Response.Redirect(Request.Url.AbsoluteUri);
            }
        }
    protected void btnSummate_Click(object sender, EventArgs e)
    {
        poDll.PurchaseOrder dll = new poDll.PurchaseOrder();
        if (btnSummate.Text == "Sum Totals" && tbUnitPrice1.Text != "")
        {
            float up1 = float.Parse(tbUnitPrice1.Text, CultureInfo.InvariantCulture);
            int   q1  = Int32.Parse(tbQuantity1.Text);
            tbFinalAmount1.Text = (up1 * q1).ToString();

            if (tbItem2.Text != "")
            {
                float up2 = float.Parse(tbUnitPrice2.Text, CultureInfo.InvariantCulture);
                int   q2  = Int32.Parse(tbQuantity2.Text);
                tbFinalAmount2.Text = (up2 * q2).ToString();
            }
            if (tbItem3.Text != "")
            {
                float up3 = float.Parse(tbUnitPrice3.Text, CultureInfo.InvariantCulture);
                int   q3  = Int32.Parse(tbQuantity3.Text);
                tbFinalAmount3.Text = (up3 * q3).ToString();
            }
            if (tbItem4.Text != "")
            {
                float up4 = float.Parse(tbUnitPrice4.Text, CultureInfo.InvariantCulture);
                int   q4  = Int32.Parse(tbQuantity4.Text);
                tbFinalAmount4.Text = (up4 * q4).ToString();
            }
            if (tbItem5.Text != "")
            {
                float up5 = float.Parse(tbUnitPrice5.Text, CultureInfo.InvariantCulture);
                int   q5  = Int32.Parse(tbQuantity5.Text);
                tbFinalAmount5.Text = (up5 * q5).ToString();
            }

            btnSummate.Visible = false;
            btnSubmit.Visible  = true;
            btnSubmit.Text     = "Submit Purchase Order";
        }
    }
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        poDll.PurchaseOrder dll = new poDll.PurchaseOrder();

        if (tbItem1.Text != "")
        {
            string orderBy = Session["StarID"].ToString();
            string vendor  = dlVendor.Text;
            int    oNum    = Int32.Parse(lblPoNumber.Text);
            int    lNum    = Int32.Parse(lblLine1.Text);
            string item    = tbItem1.Text;
            int    qty     = Int32.Parse(tbQuantity1.Text);
            float  uPrice  = float.Parse(tbUnitPrice1.Text, CultureInfo.InvariantCulture);
            float  fPrice  = float.Parse(tbFinalAmount1.Text, CultureInfo.InvariantCulture);

            int iTotalRows;

            iTotalRows = dll.PURCHASE_Insert(oNum, lNum, item, qty, uPrice, fPrice, orderBy, vendor);
            if (iTotalRows > 0)
            {
                lblMessage.Text = "Your Order was recieved Succesfully";
            }
        }
        if (tbItem2.Text != "")
        {
            string orderBy = Session["StarID"].ToString();
            string vendor  = dlVendor.Text;
            int    oNum    = Int32.Parse(lblPoNumber.Text);
            int    lNum    = Int32.Parse(lblLine2.Text);
            string item    = tbItem1.Text;
            int    qty     = Int32.Parse(tbQuantity2.Text);
            float  uPrice  = float.Parse(tbUnitPrice2.Text, CultureInfo.InvariantCulture);
            float  fPrice  = float.Parse(tbFinalAmount2.Text, CultureInfo.InvariantCulture);

            int iTotalRows;

            iTotalRows = dll.PURCHASE_Insert(oNum, lNum, item, qty, uPrice, fPrice, orderBy, vendor);
            if (iTotalRows > 0)
            {
                lblMessage.Text = "Your Order was recieved Succesfully";
            }
        }
        if (tbItem3.Text != "")
        {
            string orderBy = Session["StarID"].ToString();
            string vendor  = dlVendor.Text;
            int    oNum    = Int32.Parse(lblPoNumber.Text);
            int    lNum    = Int32.Parse(lblLine3.Text);
            string item    = tbItem1.Text;
            int    qty     = Int32.Parse(tbQuantity3.Text);
            float  uPrice  = float.Parse(tbUnitPrice3.Text, CultureInfo.InvariantCulture);
            float  fPrice  = float.Parse(tbFinalAmount3.Text, CultureInfo.InvariantCulture);

            int iTotalRows;

            iTotalRows = dll.PURCHASE_Insert(oNum, lNum, item, qty, uPrice, fPrice, orderBy, vendor);
            if (iTotalRows > 0)
            {
                lblMessage.Text = "Your Order was recieved Succesfully";
            }
        }
        if (tbItem4.Text != "")
        {
            string orderBy = Session["StarID"].ToString();
            string vendor  = dlVendor.Text;
            int    oNum    = Int32.Parse(lblPoNumber.Text);
            int    lNum    = Int32.Parse(lblLine4.Text);
            string item    = tbItem1.Text;
            int    qty     = Int32.Parse(tbQuantity4.Text);
            float  uPrice  = float.Parse(tbUnitPrice4.Text, CultureInfo.InvariantCulture);
            float  fPrice  = float.Parse(tbFinalAmount4.Text, CultureInfo.InvariantCulture);

            int iTotalRows;

            iTotalRows = dll.PURCHASE_Insert(oNum, lNum, item, qty, uPrice, fPrice, orderBy, vendor);
            if (iTotalRows > 0)
            {
                lblMessage.Text = "Your Order was recieved Succesfully";
            }
        }
        if (tbItem5.Text != "")
        {
            string orderBy = Session["StarID"].ToString();
            string vendor  = dlVendor.Text;
            int    oNum    = Int32.Parse(lblPoNumber.Text);
            int    lNum    = Int32.Parse(lblLine5.Text);
            string item    = tbItem1.Text;
            int    qty     = Int32.Parse(tbQuantity5.Text);
            float  uPrice  = float.Parse(tbUnitPrice5.Text, CultureInfo.InvariantCulture);
            float  fPrice  = float.Parse(tbFinalAmount5.Text, CultureInfo.InvariantCulture);

            int iTotalRows;

            iTotalRows = dll.PURCHASE_Insert(oNum, lNum, item, qty, uPrice, fPrice, orderBy, vendor);
            if (iTotalRows > 0)
            {
                lblMessage.Text = "Your Order was recieved Succesfully";
            }
        }
    }