예제 #1
0
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            // If built in validation finds an error
            if (IsValid != true)
            {
                return;
            }
            TextBox      Qty      = MakeList.FooterRow.FindControl("txtQty") as TextBox;
            TextBox      ItemName = MakeList.FooterRow.FindControl("txtItem") as TextBox;
            DropDownList Category = MakeList.FooterRow.FindControl("lstCategory") as DropDownList;
            TextBox      Aisle    = MakeList.FooterRow.FindControl("txtAisle") as TextBox;
            TextBox      Price    = MakeList.FooterRow.FindControl("txtPrice") as TextBox;
            TextBox      Notes    = MakeList.FooterRow.FindControl("txtNotes") as TextBox;

            AccessDataSource1.InsertParameters["ItemQuantity"].DefaultValue   = Qty.Text;
            AccessDataSource1.InsertParameters["ItemName"].DefaultValue       = ItemName.Text;
            AccessDataSource1.InsertParameters["ItemCategoryId"].DefaultValue = Category.SelectedValue;
            AccessDataSource1.InsertParameters["ItemAisle"].DefaultValue      = Aisle.Text;
            AccessDataSource1.InsertParameters["ItemPrice"].DefaultValue      = Price.Text;
            AccessDataSource1.InsertParameters["ItemNotes"].DefaultValue      = Notes.Text;
            AccessDataSource1.Insert();

            //btnAddItem.Enabled = true;
            //MakeList.ShowFooter = false;
        }
예제 #2
0
 private void adaugaInregistrare()
 {
     AccessDataSource1.InsertParameters[0].DefaultValue = TxtDProdus.Text;
     AccessDataSource1.InsertParameters[1].DefaultValue = DDLUM.Text;
     AccessDataSource1.InsertParameters[2].DefaultValue = DDLTVA.Text;
     AccessDataSource1.InsertParameters[3].DefaultValue = TxtPret.Text;
     AccessDataSource1.InsertParameters[4].DefaultValue = TxtCategorie.Text;
     AccessDataSource1.Insert();
     nullControale();
 }
    protected void ASPxUploadControl1_FileUploadComplete(object sender, FileUploadCompleteEventArgs e)
    {
        string path = "~/ImagesDB/" + e.UploadedFile.FileName;

        e.UploadedFile.SaveAs(Server.MapPath(path));

        AccessDataSource1.InsertParameters["Model"].DefaultValue         = "New Model";
        AccessDataSource1.InsertParameters["Pixels"].DefaultValue        = "0";
        AccessDataSource1.InsertParameters["ImageFileName"].DefaultValue = e.UploadedFile.FileName;

        AccessDataSource1.Insert();
    }
예제 #4
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (FileUpload1.HasFile)
        {
            FileUpload1.SaveAs(Server.MapPath(Request.ApplicationPath.ToString())
                               + "//Images//"
                               + FileUpload1.FileName);
        }

        Session["PImagePath"] = "~/Images/" + FileUpload1.FileName;

        AccessDataSource1.Insert();
    }
        protected void btnCheckout_Click(object sender, EventArgs e)
        {
            Customer currentUser = (Customer)HttpContext.Current.Session["currentUser"];

            AccessDataSource1.InsertParameters["CustomerID"].DefaultValue = currentUser.CustomerID.ToString();
            AccessDataSource1.InsertParameters["OrderDate"].DefaultValue  = DateTime.Now.ToString();
            AccessDataSource1.InsertParameters["TotalCost"].DefaultValue  = cart.TotalCost.ToString();

            AccessDataSource1.Insert();

            cart.Clear();

            Response.Redirect("Orders.aspx");
        }
예제 #6
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        DataView dv = (DataView)AccessDataSource1.Select(DataSourceSelectArguments.Empty);

        if (dv.Count == 1)
        {
            Label2.Visible = true;
            return;
        }
        else
        {
            AccessDataSource1.Insert();
            Response.Redirect("~/Login.aspx");
        }
    }
예제 #7
0
 protected void Button1_Click(object sender, EventArgs e)
 {
     AccessDataSource1.Insert();
     Response.Redirect("uyegirisi.aspx");
 }