private async void YesDialog_Clicked(object sender, DialogClickEventArgs args) { var progressDialog = ProgressDialog.Show(this, "Please wait... ", "Updating Po...", true); try { var updateupc = ((WMSApplication)Application).ItemRepository.UpdateRPoListDetail(Intent.GetStringExtra("receiver_num"), Intent.GetStringExtra("division_id")); foreach (var i in updateupc) { if (Convert.ToInt32(i.oqty) != 0) { await(ApiConnection1.ApiDebsUpdateData(GlobalVariables.GlobalUrl + "/RPoListDetailUpdate/" + i.receiver_num + "/" + i.division_id + "/" + i.upc + "/" + i.rqty + "/qwde")); } else { await(ApiConnection1.ApiDebsUpdateData(GlobalVariables.GlobalUrl + "/RPoListDetailAdd/" + i.receiver_num + "/" + i.division_id + "/" + i.upc + "/" + i.rqty + "/" + txtslot.Text + "/" + GlobalVariables.GlobalUserid)); } } //await (ApiConnection1.ApiDebsUpdateData (GlobalVariables.GlobalUrl + "RPoListUpdate/"+)); tblPoList item = new tblPoList(); var polist = ((WMSApplication)Application).ItemRepository.GetRPoListFirst(Intent.GetStringExtra("receiver_num"), Intent.GetStringExtra("division_id")); item.id = polist.id; ((WMSApplication)Application).ItemRepository.DeleteRPoList(item); progressDialog.Cancel(); var builder = new AlertDialog.Builder(this); builder.SetTitle("Debenhams"); builder.SetMessage("PO Successfully Closed"); builder.SetPositiveButton("OK", Closed_Clicked); builder.Show(); } catch (Exception ex) { progressDialog.Cancel(); Toast.MakeText(this, "Unable To Update Po.\n" + ex.Message, ToastLength.Long).Show(); } }
private async void ApiRPolist() { var progressDialog = ProgressDialog.Show(this, "Please wait...", "Downloading Data From Server...", true); try { await ApiConnection1.ApiPTLList(GlobalVariables.GlobalUrl + "/PTLList/" + GlobalVariables.GlobalUserid); refreshItems(); } catch (Exception ex) { Toast.MakeText(this, "Unable To Download Data.\n" + ex.Message, ToastLength.Long).Show(); } progressDialog.Cancel(); }
public async void ApiRSTlist() { var progressDialog = ProgressDialog.Show(this, "Please wait...", "Updating Data From Server...", true); try { var address = ConAddress.GetListArray1("select * from tblAddressList where sync='1'"); foreach (var x in address) { await(ApiConnection1.AddressId(GlobalVariables.GlobalUrl + "/addressid")); await(ApiConnection1.Updatedata(GlobalVariables.GlobalUrl + "/address/" + GlobalVariables.GlobalUserid + "/" + x.province + "/" + x.city + "/" + x.barangay + "/" + x.building_no + "/" + x.fname + "/" + x.lname + "/" + x.contact)); var member = ConMember.GetListArray1("select * from tblmember where address_id='" + x.id + "'"); foreach (var m in member) { var ename = m.ename; if (m.ename == "") { ename = "000"; } await(ApiConnection1.Updatedata(GlobalVariables.GlobalUrl + "/member/" + GlobalVariables.GlobalAddressId + "/" + m.fname + "/" + m.mname + "/" + m.lname + "/" + ename + "/" + m.rhousehold + "/" + m.gender + "/" + m.birthday + "/" + m.birth_certificate + "/" + m.marital_status + "/" + m.religion + "/" + m.school_attendance + "/" + m.literacy + "/" + m.highest_grade + "/" + m.work_status + "/" + m.occupation + "/" + m.pwd)); } var housing = ConHousing.GetListSingle("select * from tblHousing where address_id='" + x.id + "'"); await(ApiConnection1.Updatedata(GlobalVariables.GlobalUrl + "/housing/" + GlobalVariables.GlobalAddressId + "/" + housing.building + "/" + housing.roof + "/" + housing.wall + "/" + housing.light + "/" + housing.drink + "/" + housing.cooking + "/" + housing.tenure)); var death = ConDeath.GetListArray1("select * from tblDeath where address_id='" + x.id + "'"); foreach (var d in death) { await(ApiConnection1.Updatedata(GlobalVariables.GlobalUrl + "/death/" + GlobalVariables.GlobalAddressId + "/" + d.fname + "/" + d.lname + "/" + d.gender + "/" + d.age_death + "/" + d.register + "/" + d.birthcertificate)); } //ConAddress.DeleteAddressQuery("delete from tblAddressList where id='"+ housing.address_id +"'"); //ConMember.DeleteMemberQuery("delete from tblmember where address_id='"+ housing.address_id +"'"); //ConHousing.DeleteHousingQuery("delete from tblHousing where address_id='"+ housing.address_id +"'"); //ConDeath.DeleteDeathQuery("delete from tblDeath where address_id='"+ housing.address_id +"'"); Toast.MakeText(this, "Saving Successful..", ToastLength.Long).Show(); refreshItems(); } } catch (Exception ex) { Toast.MakeText(this, "Unable To Update Data.\n" + ex.Message, ToastLength.Long).Show(); } progressDialog.Cancel(); }
private async void btnlogin_click(object sender, EventArgs e) { var url = ConAddress.GetConnectionURL(); GlobalVariables.GlobalUrl = url.url; if (txtuser.Text != "" && txtpass.Text != "") { var progressDialog = ProgressDialog.Show(this, "Please wait...", "Verifying Credentials...", true); try { await(ApiConnection1.UserLogin(GlobalVariables.GlobalUrl + "/login/" + txtuser.Text + "/" + txtpass.Text)); var users = ConAddress.GetUser(); if (users.username != "") { GlobalVariables.GlobalUserid = users.user_id; GlobalVariables.GlobalFname = users.fname; GlobalVariables.GlobalLname = users.lname; var intent = new Intent(); intent.SetClass(this, typeof(ActAddress)); Toast.MakeText(this, "Login Successfully\n" + users.fname + " " + users.lname + ".", ToastLength.Long).Show(); StartActivity(intent); } else { Toast.MakeText(this, "Login Failed\nIncorect UserName Or Password..", ToastLength.Long).Show(); } } catch (Exception ex) { Toast.MakeText(this, "Unable To Connect To Server.\n" + ex.Message, ToastLength.Long).Show(); } progressDialog.Cancel(); } else { Toast.MakeText(this, "Unable To Login.\nPlease Complete Your Credential..", ToastLength.Long).Show(); } txtpass.Text = ""; }