コード例 #1
0
 protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
 {
     if (e.CommandName == "add")
     {
         Model.phototab co = pt.GetModel(Convert.ToInt32(e.CommandArgument));
         if (Label2.Text == "1")
         {
             ImageButton1.ImageUrl = co.Photourl;
             tp1 = co.id;
         }
         else if (Label2.Text == "2")
         {
             ImageButton2.ImageUrl = co.Photourl;
             tp2 = co.id;
         }
         else if (Label2.Text == "3")
         {
             ImageButton3.ImageUrl = co.Photourl;
             tp3 = co.id;
         }
         else if (Label2.Text == "4")
         {
             ImageButton4.ImageUrl = co.Photourl;
             tp4 = co.id;
         }
         else
         {
         }
     }
 }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int            id = Convert.ToInt32(Request.QueryString["id"].ToString());
         Model.OrderTab or = ot.GetModel(id);
         Label1.Text = or.OrderNumber;
         if (or.PhotoID1 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID1));
             ImageButton1.ImageUrl = ph.Photourl;
         }
         if (or.PhotoID2 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID2));
             ImageButton2.ImageUrl = ph.Photourl;
         }
         if (or.PhotoID3 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID3));
             ImageButton3.ImageUrl = ph.Photourl;
         }
         if (or.PhotoID4 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID4));
             ImageButton4.ImageUrl = ph.Photourl;
         }
         Label3.Text  = or.alllength.ToString();
         Label4.Text  = or.Imperial.ToString();
         Label5.Text  = or.QhWidth.ToString();
         Label6.Text  = or.Beizhuzz;
         Label7.Text  = or.Zengsong;
         Label8.Text  = or.MemberName;
         Label9.Text  = or.MemberPhone;
         Label10.Text = or.MemberPhone1;
         Label11.Text = or.MemberAdd;
         Label12.Text = Convert.ToDateTime(or.validity).ToString("yyyy-MM-dd");
         Label13.Text = or.AllMoney.ToString();
         Label14.Text = or.Deposit.ToString();
         Maticsoft.Model.Homemadetab ho = hot.GetModel(Convert.ToInt32(or.HomemadeID));
         ImageButton5.ImageUrl = ho.Photourl;
         if (or.Zhuangtai2 == 1)
         {
             Label15.Text = "未付全款";
         }
         else if (or.Zhuangtai2 == 2)
         {
             Label15.Text = "已付全款";
         }
         else
         {
             Label15.Text = "状态异常";
         }
     }
 }
コード例 #3
0
 /// <summary>
 /// 添加自制商品(确定按钮)
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void ImageButton1_Click(object sender, EventArgs e)
 {
     try
     {
         string         t  = Convert.ToString("TP" + DateTime.Now.ToString("yyyyMMddhhmmss"));
         Model.phototab ho = new Model.phototab();
         if (FileUpload1.FileName != "")
         {
             string name1  = FileUpload1.FileName;//上传文件名字
             string type1  = FileUpload1.PostedFile.ContentType;
             string type11 = name1.Substring(name1.LastIndexOf(".") + 1);
             //string path1 = HttpContext.Current.Request.MapPath("~/") + "picture\\" + FileUpload1.FileName;
             if (type11 == "jpg" || type11 == "gif" || type11 == "bmp" || type11 == "png")
             {
                 string ming1 = name1.Substring(name1.Length - 4, 4);
                 string wj1   = t + ming1;
                 string path  = HttpContext.Current.Request.MapPath("~/") + "tupian\\";
                 FileUpload1.SaveAs(path + wj1);
                 ho.Photourl = "../tupian/" + wj1;
                 ho.beizhu   = "1";
                 int a = pt.Add(ho);
                 if (a > 0)
                 {
                     ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('添加成功!');</script>");
                     bind();
                 }
                 else
                 {
                     ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('添加失败!');</script>");
                     bind();
                 }
             }
             else
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('图片格式不正确请传(.jpg/.gif/.bmp/.png)!');</script>");
                 ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>javascript:showDiv1();</script>");
             }
         }
         else
         {
             ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('请选择图片!');</script>");
             ClientScript.RegisterStartupScript(ClientScript.GetType(), "myscript", "<script>javascript:showDiv1();</script>");
         }
     }
     catch (Exception ee)
     {
         //Response.Write("<script>alert('确定异常 " + ee.Message + "')</script>");
         ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('确定异常 " + ee.Message + "');</script>");
     }
 }
コード例 #4
0
 /// <summary>
 /// 删除
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void LinkButton2_Click(object sender, EventArgs e)
 {
     try
     {
         //获取button 控件
         LinkButton lb = (LinkButton)sender;
         //获取传过来的commwntid
         int     id = Convert.ToInt32(lb.CommandArgument);
         DataSet de = or.GetList(" (PhotoID1 like '" + id + "' or PhotoID2 like '" + id + "' or PhotoID3 like '" + id + "' or PhotoID4 like '" + id + "' )");
         if (de.Tables[0].Rows.Count > 0)
         {
             Model.phototab dd = pt.GetModel(id);
             dd.beizhu = "0";
             bool a = pt.Update(dd);
             if (a == true)
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('停用成功!');</script>");
                 bind();
             }
             else
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('停用失败!');</script>");
                 bind();
             }
         }
         else
         {
             bool aa = pt.Delete(id);
             if (aa == true)
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('删除成功!');</script>");
                 bind();
             }
             else
             {
                 ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('删除失败!');</script>");
                 bind();
             }
         }
     }
     catch (Exception ee)
     {
         //Response.Write("<script>alert('确定异常 " + ee.Message + "')</script>");
         ClientScript.RegisterClientScriptBlock(this.GetType(), "this", "<script language=javascript>alert('删除异常 " + ee.Message + "');</script>");
     }
 }
コード例 #5
0
 Maticsoft.BLL.Homemadetab hot  = new BLL.Homemadetab();  //自制商品
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         int            id = Convert.ToInt32(Request.QueryString["id"].ToString());
         Model.OrderTab or = ot.GetModel(id);
         Label1.Text = or.OrderNumber;
         if (or.PhotoID1 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID1));
             ImageButton1.ImageUrl = ph.Photourl;
         }
         if (or.PhotoID2 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID2));
             ImageButton2.ImageUrl = ph.Photourl;
         }
         if (or.PhotoID3 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID3));
             ImageButton3.ImageUrl = ph.Photourl;
         }
         if (or.PhotoID4 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(or.PhotoID4));
             ImageButton4.ImageUrl = ph.Photourl;
         }
         Label3.Text  = or.alllength.ToString();
         Label4.Text  = or.Imperial.ToString();
         Label5.Text  = or.QhWidth.ToString();
         Label6.Text  = or.Beizhuzz;
         Label7.Text  = or.Zengsong;
         Label8.Text  = or.MemberName;
         Label9.Text  = or.MemberPhone;
         Label10.Text = or.MemberPhone1;
         Label11.Text = or.MemberAdd;
         Label12.Text = Convert.ToDateTime(or.validity).ToString("yyyy-MM-dd");
         Label13.Text = or.AllMoney.ToString();
         Label14.Text = or.Deposit.ToString();
         Label15.Text = or.Beizhuwg;
         Maticsoft.Model.Homemadetab ho = hot.GetModel(Convert.ToInt32(or.HomemadeID));
         ImageButton5.ImageUrl = ho.Photourl;
         if (or.Zhuangtai2 == 1)
         {
             Label23.Text = "未付全款";
         }
         else if (or.Zhuangtai2 == 2)
         {
             Label23.Text = "已付全款";
         }
         else
         {
             Label23.Text = "状态异常";
         }
         DataSet ds = ct.GetList(" OrderNumber like '" + Label1.Text + "'");
         if (ds.Tables[0].Rows.Count > 0)
         {
             for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
             {
                 Model.ContractTab con = ct.GetModel(Convert.ToInt32(ds.Tables[0].Rows[i]["id"]));
                 if (con.By1 == 1)
                 {
                     Label16.Text = con.CommodityID;
                 }
                 else if (con.By1 == 2)
                 {
                     Label17.Text = con.CommodityID;
                 }
                 else if (con.By1 == 3)
                 {
                     Label18.Text = con.CommodityID;
                 }
                 else if (con.By1 == 4)
                 {
                     Label19.Text = con.CommodityID;
                 }
                 else if (con.By1 == 5)
                 {
                     Label20.Text = con.CommodityID;
                 }
                 else if (con.By1 == 6)
                 {
                     Label21.Text = con.CommodityID;
                 }
                 else if (con.By1 == 7)
                 {
                     Label22.Text = con.CommodityID;
                 }
                 else
                 {
                 }
                 if (i == ds.Tables[0].Rows.Count - 1)
                 {
                     if (Label16.Text == "")
                     {
                         Label16.Text = "无";
                     }
                     if (Label17.Text == "")
                     {
                         Label17.Text = "无";
                     }
                     if (Label18.Text == "")
                     {
                         Label18.Text = "无";
                     }
                     if (Label19.Text == "")
                     {
                         Label19.Text = "无";
                     }
                     if (Label20.Text == "")
                     {
                         Label20.Text = "无";
                     }
                     if (Label21.Text == "")
                     {
                         Label21.Text = "无";
                     }
                     if (Label22.Text == "")
                     {
                         Label22.Text = "无";
                     }
                 }
             }
         }
         else
         {
             Label16.Text = "无";
             Label17.Text = "无";
             Label18.Text = "无";
             Label19.Text = "无";
             Label20.Text = "无";
             Label21.Text = "无";
             Label22.Text = "无";
         }
     }
 }
コード例 #6
0
 static int zzspid = 0; //自制商品ID
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         id = Convert.ToInt32(Request.QueryString["id"].ToString());
         bind();
         bind1();
         Model.OrderTab ord = ot.GetModel(id);
         Label1.Text = ord.OrderNumber;
         if (ord.PhotoID1 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(ord.PhotoID1));
             ImageButton1.ImageUrl = ph.Photourl;
             tp1 = ph.id;
         }
         if (ord.PhotoID2 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(ord.PhotoID2));
             ImageButton2.ImageUrl = ph.Photourl;
             tp2 = ph.id;
         }
         if (ord.PhotoID3 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(ord.PhotoID3));
             ImageButton3.ImageUrl = ph.Photourl;
             tp3 = ph.id;
         }
         if (ord.PhotoID4 != 0)
         {
             Model.phototab ph = pt.GetModel(Convert.ToInt32(ord.PhotoID4));
             ImageButton4.ImageUrl = ph.Photourl;
             tp4 = ph.id;
         }
         TextBox1.Text  = ord.alllength.ToString();
         TextBox2.Text  = ord.Imperial.ToString();
         TextBox3.Text  = ord.QhWidth.ToString();
         TextBox4.Text  = ord.Beizhuzz;
         TextBox5.Text  = ord.Beizhuwg;
         TextBox6.Text  = ord.Zengsong;
         TextBox7.Text  = ord.MemberName;
         TextBox8.Text  = ord.MemberPhone;
         TextBox9.Text  = ord.MemberPhone1;
         TextBox10.Text = ord.MemberAdd;
         TextBox11.Text = Convert.ToDateTime(ord.validity).ToString("yyyy-MM-dd");
         TextBox12.Text = ord.AllMoney.ToString();
         Label4.Text    = ord.Deposit.ToString();
         Model.Homemadetab hom = ht.GetModel(Convert.ToInt32(ord.HomemadeID));
         zzspid = hom.id;
         ImageButton5.ImageUrl = hom.Photourl;
         DataSet ds = ct.GetList(" OrderNumber like '" + Label1.Text + "'");
         if (ds.Tables[0].Rows.Count > 0)
         {
             for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
             {
                 Model.ContractTab con = ct.GetModel(Convert.ToInt32(ds.Tables[0].Rows[i]["id"]));
                 if (con.By1 == 1)
                 {
                     TextBox14.Text = con.CommodityID;
                 }
                 else if (con.By1 == 2)
                 {
                     TextBox15.Text = con.CommodityID;
                 }
                 else if (con.By1 == 3)
                 {
                     TextBox16.Text = con.CommodityID;
                 }
                 else if (con.By1 == 4)
                 {
                     TextBox17.Text = con.CommodityID;
                 }
                 else if (con.By1 == 5)
                 {
                     TextBox18.Text = con.CommodityID;
                 }
                 else if (con.By1 == 6)
                 {
                     TextBox19.Text = con.CommodityID;
                 }
                 else if (con.By1 == 7)
                 {
                     TextBox20.Text = con.CommodityID;
                 }
                 else
                 {
                 }
             }
         }
     }
 }