예제 #1
0
        private void BindData()
        {
            CanteenService.IitemServiceClient item = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService");
            DataSet li = item.GetItem();

            GridView1.DataSource = li;
            GridView1.DataBind();
        }
        public void disp_data()
        {
            CanteenService.IitemServiceClient item = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService");
            DataSet li = item.GetItem();

            GridView1.DataSource = li;
            GridView1.DataBind();
            conn.Close();
        }
        protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            CanteenService.IitemServiceClient pr = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService");

            int ID = (int)e.Keys["id"];

            pr.RemoveItem(ID);
            // Delete here the database record for the selected patientID
            BindData();
        }
        private void BindData()
        {
            CanteenService.IitemServiceClient  item = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService");
            CanteenService.IorderServiceClient or   = new CanteenService.IorderServiceClient("BasicHttpBinding_IorderService");
            DataSet li = item.GetItem();
            DataSet oi = or.GetAllOrderHistory();

            GridView1.DataSource = li;
            GridView1.DataBind();
            GridView2.DataSource = oi;
            GridView2.DataBind();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!(Page.IsPostBack))
     {
         CanteenService.IitemServiceClient item = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService");
         DataSet li = item.GetItem();
         ListBox1.DataSource     = li.Tables[0].DefaultView;
         ListBox1.DataTextField  = "Name";
         ListBox1.DataValueField = "price";
         ListBox1.DataBind();
         disp_data();
     }
 }
예제 #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            CanteenService.IitemServiceClient it = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService");
            Item ito = new Item();

            ito.id          = int.Parse(TextBox9.Text);
            ito.Name        = TextBox1.Text;
            ito.Description = TextBox2.Text;
            ito.price       = int.Parse(TextBox6.Text);
            ito.Category    = TextBox7.Text;
            ito.status      = TextBox8.Text;
            it.AddItem(ito);
            BindData();
        }
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            CanteenService.IitemServiceClient it = new CanteenService.IitemServiceClient("BasicHttpBinding_IitemService");
            Item   p        = new Item();
            int    ID       = (int)e.Keys["id"];
            string name     = (string)e.NewValues["Name"];
            string quantity = (string)e.NewValues["Description"];
            string status   = (string)e.NewValues["status"];
            string cb       = (string)e.NewValues["Category"];
            int    price    = int.Parse((string)e.NewValues["price"]);

            p.id          = ID;
            p.Name        = name;
            p.Description = quantity;
            p.price       = price;
            p.status      = status;
            p.Category    = cb;
            it.UpdateItem(p);
            GridView1.EditIndex = -1;
            BindData();
        }