-
Notifications
You must be signed in to change notification settings - Fork 0
/
ManagePhones.aspx.cs
35 lines (34 loc) · 1.14 KB
/
ManagePhones.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class ManagePhones : System.Web.UI.Page
{
BLLPhone blp = new BLLPhone();
BLLManufacturer blm = new BLLManufacturer();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
DataTable dt = blm.GetAllManufacturer();
ddlManufacturer.DataSource = dt;
ddlManufacturer.DataTextField = "ManuName";
ddlManufacturer.DataValueField = "ManuID";
ddlManufacturer.DataBind();
}
}
protected void btnAdd_Click1(object sender, EventArgs e)
{
int i = blp.AddPhone(Convert.ToInt32(ddlManufacturer.SelectedValue.ToString()), txtPhone.Text, Convert.ToDecimal(txtPrice.Text), PhotoUpload.FileName);
if (i > 0)
{
PhotoUpload.SaveAs(Server.MapPath("~/Phoneimages" + PhotoUpload.FileName));
lblMessage.Text = "Phone Added";
txtPhone.Text = "";
txtPrice.Text = "";
}
}
}