Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > Mobile > Mobile Forum > WP - How to edit selected product in windows phone using php?



 

WP - How to edit selected product in windows phone using php?

 



Topic : 100132



โพสกระทู้ ( 4 )
บทความ ( 0 )



สถานะออฟไลน์




Hi i am developing windows phone app. I have added product to mysql table depends upon customer_id, product_id and retailer_id. I have added table same products but different retailers.when i tap edit button i cannot edit particular product but alternatively first product only editing. so any tell me how to edit particular product depends upon cutomer id, product id and retailer id.

I will show my code given below

Code (ASP)
<StackPanel Margin="20,0,0,0" HorizontalAlignment="Left" Width="200" >
                                                <Button Height="70" Content="EDIT" Tag="{Binding product_id}" Name="btnEdit" Foreground="White" FontWeight="Medium" BorderBrush="#57842c" BorderThickness="2,0,2,0" Margin="-18,0,0,0" Click="Edit">
                                                    <Button.Background>
                                                        <ImageBrush ImageSource="Images/submit_bg.png" Stretch="Fill"  />
                                                        
                                                    </Button.Background>
                                                </Button>
                                            </StackPanel>


Code (C#)
private void Edit(object sender, RoutedEventArgs e)
        {
           
           Button btnEdit = (Button)e.OriginalSource;
           NavigationService.Navigate(new Uri("/EditWatchList.xaml?scustomerID=" + btnEdit.Tag.ToString() + "," + sretailer_id, UriKind.Relative));
        }



Edit Page

Code (C#)
rivate void MainPage_Loaded(object sender, System.Windows.RoutedEventArgs e)
        {
            string url = "http://www.bestinuk.com/BestinUk_Windows/getProductID.php";
            Uri uri = new Uri(url, UriKind.Absolute);
            NavigationContext.QueryString.TryGetValue("scustomerID", out strproductID);

            StringBuilder postData = new StringBuilder();
            postData.AppendFormat("{0}={1}", "customer_id", HttpUtility.UrlEncode(LoginPage.strcustomer_id_k));
            postData.AppendFormat("&{0}={1}", "product_id", HttpUtility.UrlEncode(strproductID));
            postData.AppendFormat("&{0}={1}", "retailer_id", HttpUtility.UrlEncode(InputList.sretailer_id));

            WebClient client = default(WebClient);
            client = new WebClient();
            client.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            client.Headers[HttpRequestHeader.ContentLength] = postData.Length.ToString();

            client.UploadStringCompleted += client_UploadStringCompleted;
            client.UploadProgressChanged += client_UploadProgressChanged;

            client.UploadStringAsync(uri, "POST", postData.ToString());

            prog = new ProgressIndicator();
            prog.IsIndeterminate = true;
            prog.IsVisible = true;
            prog.Text = "Loading....";
            SystemTray.SetProgressIndicator(this, prog);
        }
        private void client_UploadProgressChanged(object sender, UploadProgressChangedEventArgs e)
        {
            //Me.txtResult.Text = "Uploading.... " & e.ProgressPercentage & "%"
        }
        private void client_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
        {
           
            if (e.Cancelled == false && e.Error == null)
            {
                Member myMember = ReadToObject(e.Result.ToString());
                this.targetPrices.Text = myMember.target_price.ToString();
                this.txtretailers.Text = myMember.retailer.ToString();
                this.txtperiod.Text = myMember.period.ToString();
                this.txtmobile.Text = myMember.mobile.ToString();
                prog.IsVisible = false;
            }
        }
        public static Member ReadToObject(string json)
        {
            Member deserializedMember = new Member();
            MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(json));
            DataContractJsonSerializer ser = new DataContractJsonSerializer(deserializedMember.GetType());
            deserializedMember = ser.ReadObject(ms) as Member;
            ms.Close();
            return deserializedMember;
        }




Tag : Mobile, Device (Mobile), C#, Windows Phone, Windows, Web Service







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-09-06 13:33:26 By : Dashi View : 919 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์
Twitter Facebook

for Example



Windows Phone Edit Update data to Web Server







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-09-06 16:19:26 By : mr.win
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : WP - How to edit selected product in windows phone using php?
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่