Beispiel #1
0
        protected void btn_Save_Click(object sender, EventArgs e)
        {
            Model.t_waste waste = new Model.t_waste();
            waste.was_name        = was_name.Text;
            waste.was_number      = Convert.ToInt32(was_number.Text);
            waste.was_price       = decimal.Parse(was_price.Text);
            waste.was_recoverable = int.Parse(ddl_c.SelectedValue);
            waste.was_cate_ID     = Convert.ToInt32(ddl_d.SelectedValue);
            string _nid = (Request["wid"] == null) ? "1" : Request["wid"];

            waste.was_pic_ID = Convert.ToInt32(_nid);
            waste.was_valid  = was_valid.Text;
            new BLL.t_waste().Add(waste);
            Response.Redirect("WasteView.aspx");
        }
Beispiel #2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            HttpPostedFile file  = fup_com_img.PostedFile;
            int            imgId = UploadFile(file);

            if (imgId >= 0)
            {
                string        name  = txt_i_name.Text;
                string        c1    = ddl_c.SelectedValue;
                string        c2    = ddl_d.SelectedValue;
                string        price = iprice.Text;
                string        vaild = chk_e_enable.Text;
                Model.t_waste waste = new Model.t_waste();
                waste.was_name        = txt_i_name.Text;
                waste.was_pic_ID      = imgId;
                waste.was_price       = decimal.Parse(price);
                waste.was_cate_ID     = Convert.ToInt32(c2);
                waste.was_recoverable = Convert.ToInt32(c1);
                waste.was_valid       = vaild;

                new BLL.t_waste().Add(waste);
            }
        }