protected void Btnsave_click(object sender, EventArgs e) { Guid uid = Guid.NewGuid(); if (FileUploadPhoto.HasFile) { FileUploadPhoto.SaveAs(Server.MapPath("~/photo/SubCatPhoto/" + uid + ".jpg").ToString()); } subCat.Insert(Convert.ToDecimal(DropDownListcat.SelectedValue), TxtSubCat.Text, uid, TxtShortdesc.Text, TxtDesc.Text, DropDownListStatus.SelectedValue, Txtremark.Text); Response.Write("save Successfully"); }
protected void BtnUpdate_Click(object sender, EventArgs e) { Guid uid = new Guid(lbluid.Text); if (FileUploadPhoto.HasFile) { FileUploadPhoto.SaveAs(Server.MapPath("~/photo/category/" + uid + ".jpg").ToString()); } cat.Update(txtcategory.Text, uid, txtshortdesc.Text, txtshortdesc.Text, DropDownCat.SelectedValue, null, Convert.ToDecimal(lblCategoryId.Text)); Response.Write("Update Sucessfully.."); }
protected void Btnsave_click(object sender, EventArgs e) { Guid gd = Guid.NewGuid(); if (FileUploadPhoto.HasFile) { FileUploadPhoto.SaveAs(Server.MapPath("~/photo/category/" + gd + ".jpg").ToString()); } cat.Insert(txtcategory.Text, gd, txtshortdesc.Text, txtshortdesc.Text, DropDownCat.SelectedValue, null); Response.Write("<Script>alert('Save...')</Script>"); }
protected void BtnUpdate_Click(object sender, EventArgs e) { Guid uid = new Guid(lbluid.Text); if (FileUploadPhoto.HasFile) { FileUploadPhoto.SaveAs(Server.MapPath("~/photo/Product/" + uid + ".jpg").ToString()); } Product.Update(TxtTitle.Text, Convert.ToDecimal(DropDownListsubcat.SelectedValue), uid, TxtShortdesc.Text, txtdes.Text, TxtPrice.Text, TxtDiscount.Text, txtActualPrice.Text, DropDownListStatus.SelectedValue, txtremark.Text, Convert.ToDecimal(lblProductId.Text)); Response.Write("Update Sucessfully.."); }
protected void BtnUpdate_Click(object sender, EventArgs e) { Guid uid = new Guid(lbluid.Text); if (FileUploadPhoto.HasFile) { FileUploadPhoto.SaveAs(Server.MapPath("~/photo/SubCatPhoto/" + uid + ".jpg").ToString()); } subCat.Update(Convert.ToDecimal(DropDownListcat.SelectedValue), TxtSubCat.Text, uid, TxtShortdesc.Text, TxtDesc.Text, DropDownListStatus.SelectedValue, Txtremark.Text, Convert.ToDecimal(lblSubCategoryId.Text)); Response.Write("Update Sucessfully.."); }
protected void btn_Envoyer_Click(object sender, EventArgs e) { if (Page.IsValid) { if (!string.IsNullOrEmpty(FileUploadPhoto.FileName)) { try { FileUploadPhoto.SaveAs(MapPath(@"~/Photo/" + FileUploadPhoto.FileName)); ImagePhoto.ImageUrl = @"~/Photo/" + FileUploadPhoto.FileName; } catch (Exception ex) { Console.WriteLine(ex.Message); } } } else { Response.Write("La page n'est pas valide"); } }