Ejemplo n.º 1
0
 protected void SearchVendorID2_Click(object sender, EventArgs e)
 {
     using (SqlConnection Conn = new SqlConnection(strConnectString))
     {
         if (SearchVendorID2.Text.Length > 0)
         {
             string         strsql    = "select DISTINCT  vendor_id,vendor_name from bas_vendor_master ";
             string         strwhere  = " where vendor_id like '%" + SearchVendorID2TB.Text + "%' or vendor_name like '%" + SearchVendorID2TB.Text + "%'";
             DataTable      DT        = new DataTable();
             SqlDataAdapter myAdapter = new SqlDataAdapter(strsql + strwhere, Conn);
             myAdapter.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 VendorGV.DataSource = DT;
                 VendorGV.DataBind();
             }
             else
             {
                 Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('搜尋不到資料');</script>");
             }
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('請輸入資料');</script>");
         }
     }
     ModalPopupExtender1.Show();
 }
Ejemplo n.º 2
0
 protected void SearchVendorID2_Click(object sender, EventArgs e)
 {
     using (SqlConnection Conn = new SqlConnection(strConnectString))
     {
         if (SearchVendorID2.Text.Length > 0)
         {
             string         strsql    = "select DISTINCT  vendor_id,vendor_name from bas_vendor_master ";
             string         strwhere  = " where vendor_id like '%" + SearchVendorID2TB.Text + "%' or vendor_name like '%" + SearchVendorID2TB.Text + "%'";
             DataTable      DT        = new DataTable();
             SqlDataAdapter myAdapter = new SqlDataAdapter(strsql + strwhere, Conn);
             myAdapter.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 VendorGV.DataSource = DT;
                 VendorGV.DataBind();
             }
             else
             {
                 F_ErrorShow("搜尋不到資料");
             }
         }
         else
         {
             F_ErrorShow("請輸入資料");
         }
     }
     ModalPopupExtender1.Show();
 }
Ejemplo n.º 3
0
 protected void SearchVendorIDBT_Click(object sender, ImageClickEventArgs e)
 {
     //Label4.Text = "客戶名稱或代號:";
     SearchVendorID2TB.Text = "";
     if (VendorGV.Rows.Count > 0)
     {
         MessageLB.Text      = "";
         VendorGV.DataSource = null;
         VendorGV.DataBind();
         UpdatePanel1.Update();
     }
     UpdatePanel3.Update();
     ModalPopupExtender1.Show();
 }
Ejemplo n.º 4
0
 protected void SearchVendorID2_Click(object sender, EventArgs e)
 {
     MessageLB.Text = "";
     if (VendorGV.Rows.Count > 0)
     {
         VendorGV.DataSource = null;
         VendorGV.DataBind();
         //UpdatePanel1.Update();
     }
     using (SqlConnection Conn = new SqlConnection(strConnectString))
     {
         if (SearchVendorID2TB.Text.Length > 0)
         {
             string strsql;
             strsql = string.Format("select distinct cus_id,cus_name_brief,cus_name from view_bas_cus_master where cus_id like '%{0}%' or cus_name_brief like '%{0}%' or cus_name  like '%{0}%' ", SearchVendorID2TB.Text.ToUpper());
             DataTable      DT        = new DataTable();
             SqlDataAdapter myAdapter = new SqlDataAdapter(strsql, Conn);
             myAdapter.Fill(DT);
             if (DT.Rows.Count > 0)
             {
                 VendorGV.DataSource = DT;
                 VendorGV.DataBind();
             }
             else
             {
                 //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('搜尋不到資料');</script>");
                 MessageLB.Text = "搜尋不到資料";
             }
         }
         else
         {
             //Page.ClientScript.RegisterStartupScript(Page.GetType(), "", "<script>alert('請輸入資料');</script>");
             MessageLB.Text = "請輸入資料";
         }
     }
     ModalPopupExtender1.Show();
 }