Ejemplo n.º 1
0
        protected void Button1_Click(object sender, EventArgs e)

        {
            string name     = this.TextBox1.Text;
            string type     = this.DropDownList1.SelectedItem.Text;
            string datatime = this.TextBox2.Text;

            this.Repeater1.DataSource = ShebeiManger.selectlist(name, type, datatime);
            this.DataBind();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            shebei sb = new shebei();

            sb.Name = this.TextBox1.Text;
            if (this.DropDownList1.SelectedItem.Text == "常用类")
            {
                sb.Typeid = 1;
            }
            if (this.DropDownList1.SelectedItem.Text == "普通类")
            {
                sb.Typeid = 2;
            }
            if (this.DropDownList1.SelectedItem.Text == "其他类")
            {
                sb.Typeid = 3;
            }
            sb.Xinghao     = this.TextBox3.Text;
            sb.Pinpai      = this.TextBox4.Text;
            sb.XulieNumber = this.TextBox5.Text;
            sb.Shopdata    = this.TextBox7.Text;
            sb.Outdata     = this.TextBox8.Text;
            sb.Factory     = this.TextBox6.Text;

            if (FileUpload2.HasFile)
            {
                string filename    = FileUpload2.FileName;
                string ex          = filename.Substring(filename.LastIndexOf("."));
                string newfilename = DateTime.Now.Ticks.ToString() + new Random().Next(100000, 1000000) + ex;
                string path        = Server.MapPath("/") + "Images/";
                FileUpload2.SaveAs(path + newfilename);
                this.TextBox2.Text   = "Images/" + newfilename;
                sb.Url               = "Images/" + newfilename;
                sb.Beizu             = this.TextBox11.Text;
                this.Image1.ImageUrl = sb.Url;
            }

            this.TextBox2.Text = sb.Url;
            if (ShebeiManger.update(sb))
            {
                Response.Write("<script>alert('更新成功!')</script>");
            }
        }
Ejemplo n.º 3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                List <SheBeiType> list1 = TypeManger.select();
                foreach (SheBeiType sb1 in list1)
                {
                    ListItem li1 = new ListItem();
                    li1.Value = sb1.TypeId.ToString();
                    li1.Text  = sb1.Typename;
                    this.DropDownList1.Items.Add(li1);
                }
                this.DropDownList1.Items.Insert(0, "----请选择类型----");
            }


            this.Repeater1.DataSource = ShebeiManger.select();
            this.DataBind();
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            Serice sc = new Serice();

            sc.Name = Request["name"].ToString();

            List <shebei> list = ShebeiManger.select(sc.Name);

            foreach (shebei item in list)
            {
                sc.shebeiID = item.ID;
            }



            if (Request["type"].ToString() == "常用类")
            {
                sc.DeviceType = 1;
            }
            if (Request["type"].ToString() == "普通类")
            {
                sc.DeviceType = 2;
            }
            if (Request["type"].ToString() == "其他类")
            {
                sc.DeviceType = 3;
            }
            sc.Area = Request["area"].ToString();

            sc.Weixiuer   = this.TextBox1.Text;
            sc.Guzhang    = this.TextBox2.Text;
            sc.WeixiuData = this.TextBox3.Text;
            sc.Money      = this.TextBox4.Text;
            sc.UseTime    = this.TextBox5.Text;
            sc.Beizu      = this.TextBox6.Text;
            sc.Url        = "Images/";
            if (SericeManger.add(sc))
            {
                ClientScript.RegisterStartupScript(this.GetType(), "loginSucess", "<script>alert('提交成功! ')</script>");
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            shebei sb = new shebei();

            sb.Name = this.TextBox1.Text;
            if (this.DropDownList1.Text == "常用类")
            {
                sb.Typeid = 1;
            }
            if (this.DropDownList1.Text == "普通类")
            {
                sb.Typeid = 1;
            }
            if (this.DropDownList1.Text == "其他类")
            {
                sb.Typeid = 1;
            }
            sb.Xinghao     = this.TextBox3.Text;
            sb.Pinpai      = this.TextBox4.Text;
            sb.XulieNumber = this.TextBox5.Text;
            sb.Shopdata    = this.TextBox7.Text;
            sb.Outdata     = this.TextBox8.Text;
            sb.Factory     = this.TextBox6.Text;

            if (FileUpload2.HasFile)
            {
                string filename    = FileUpload2.FileName;
                string ex          = filename.Substring(filename.LastIndexOf("."));
                string newfilename = DateTime.Now.Ticks.ToString() + new Random().Next(100000, 1000000) + ex;
                string path        = Server.MapPath("/") + "Images/";
                FileUpload2.SaveAs(path + newfilename);
                this.TextBox2.Text = "Images/" + newfilename;
                sb.Url             = "Images/" + newfilename;
                sb.Beizu           = this.TextBox11.Text;
                if (ShebeiManger.insert(sb))
                {
                    ClientScript.RegisterStartupScript(this.GetType(), "loginSucess", "<script>alert('添加成功! ')</script>");
                }
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         List <shebei> list = ShebeiManger.select();
         foreach (shebei sb in list)
         {
             ListItem li = new ListItem();
             li.Value = sb.ID.ToString();
             li.Text  = sb.Name;
             this.DropDownList1.Items.Add(li);
         }
         List <SheBeiType> list1 = TypeManger.select();
         foreach (SheBeiType sb1 in list1)
         {
             ListItem li1 = new ListItem();
             li1.Value = sb1.TypeId.ToString();
             li1.Text  = sb1.Typename;
             this.DropDownList2.Items.Add(li1);
         }
     }
 }