public string Update([FromBody] InboundModel inboundModel) { string redHawkTokenUsername = Request.Headers.GetValues("redHawkTokenUsername").First(); string redHawkTokenPassword = Request.Headers.GetValues("redHawkTokenPassword").First(); string editedInboundXMlString = string.Empty; int actionResult = 0; var validUser = accountController.ValidateRedHawkToken(redHawkTokenUsername, redHawkTokenPassword); if (validUser) { if (inboundModel != null) { var stringwriter = new System.IO.StringWriter(); var serializer = new XmlSerializer(typeof(InboundXmlViewModel.Policy_transaction_group)); serializer.Serialize(stringwriter, inboundModel.InboundXml); editedInboundXMlString = stringwriter.ToString(); actionResult = inboundDAL.UpdateInboundXML(inboundModel.CeaXmlId, editedInboundXMlString, inboundModel.ProcessingStatus); } } if (actionResult == 0) { return("0"); } else { return("1"); } }
private void VenderNameEntry_Focused(object sender, FocusEventArgs e) { InboundModel selectedItem = (InboundModel)(BindingContext as InboundViewModel).InboundList.Where(i => i.InvoiceNumber == ((Entry)sender).ReturnCommandParameter).FirstOrDefault(); //this.collectionView.SelectedItem = selectedItem; collectionView.SelectedItems.Add(selectedItem); }
public ActionResult TabPartial(InboundModel inboundModel) { InboundXmlViewModel.Policy_transaction_group policyTransactionGroupModel = new InboundXmlViewModel.Policy_transaction_group(); policyTransactionGroupModel = inboundModel.InboundXml; if (processingStatusList != null) { ViewBag.Status = processingStatusList; } else { ViewBag.Status = string.Empty; } return(PartialView(inboundModel)); }
public IEnumerable <InboundModel> InboundSearch(InboundSearchModel inboundSearchModel) { try { List <InboundModel> inboundModelList = new List <InboundModel>(); SqlConnection sqlConnection = new SqlConnection(sqlConnectionString); SqlCommand sqlCommand = new SqlCommand("assp_CEAInboundXMLSearch", sqlConnection); sqlCommand.CommandType = CommandType.StoredProcedure; sqlCommand.Parameters.AddWithValue("@CompanionPolicyNumber", inboundSearchModel.CompanionPolicyNumber); sqlCommand.Parameters.AddWithValue("@FileName", inboundSearchModel.FileName); sqlCommand.Parameters.AddWithValue("@CompanyId", inboundSearchModel.CompanyId); sqlCommand.Parameters.AddWithValue("@CEAXMLId", inboundSearchModel.CeaXmlId); sqlCommand.Parameters.AddWithValue("@FileDate", inboundSearchModel.FileDate); sqlCommand.Parameters.AddWithValue("@TransactionType", inboundSearchModel.TransactionType); sqlCommand.Parameters.AddWithValue("@ProcessingStatus", inboundSearchModel.ProcessingStatus); sqlConnection.Open(); SqlDataReader rdr = sqlCommand.ExecuteReader(); while (rdr.Read()) { InboundModel inboundModel = new InboundModel(); inboundModel.CeaXmlId = Convert.ToInt32(rdr["CEA_xml_id"]); inboundModel.PolicyId = Convert.ToInt32(rdr["policy_id"]); inboundModel.CompanyId = Convert.ToInt32(rdr["company_id"]); inboundModel.PolicyNumber = rdr["policy_number"].ToString(); inboundModel.FileName = rdr["filename"].ToString(); inboundModel.TransactionType = rdr["transactiontype"].ToString(); inboundModel.ProcessingStatus = rdr["proccessingstatus"].ToString(); inboundModel.PolicyExpirationDate = rdr["policy_expiration_date"].ToString(); inboundModel.PolicyEffectiveDate = rdr["policy_effective_date"].ToString(); inboundModel.CompanionPolicyNumber = rdr["companion_policy_number"].ToString(); inboundModelList.Add(inboundModel); } sqlConnection.Close(); return(inboundModelList); } catch (Exception ex) { throw ex; } }
private async void listItem_Tapped(object sender, EventArgs e) { InboundModel selectedItem = (InboundModel)(BindingContext as InboundViewModel).InboundList.Where(i => i.InvoiceNumber == ((TappedEventArgs)e).Parameter).FirstOrDefault(); this.collectionView.SelectedItem = selectedItem; foreach (var item in Navigation.NavigationStack) { //Console.WriteLine("Title => " + item.BindingContext); //중복 클릭 방지 if (item.BindingContext != null && item.BindingContext.ToString().EndsWith("InboundItemsViewModel")) { return; } } //await Navigation.PushAsync(new InboundItemsView(selectedItem)); //await Navigation.PushAsync(new InboundItemsView()); }
public async Task <ActionResult> UpdatedInboundXMl(InboundModel inboundModel) { List <InboundModel> inboundModelListTemp = new List <InboundModel>(); inboundModelListTemp = ((List <InboundModel>)Session["TabData"]) ?? new List <InboundModel>(); RedHawkToken redHawkToken = new RedHawkToken(); if (Session["RedHawkToken"] != null) { redHawkToken = (RedHawkToken)Session["RedHawkToken"]; } if (redHawkToken.IsAuthenticated) { using (var client = new HttpClient()) { //Sending request to find web api REST service resource UpateInboundXML using HttpClient client.DefaultRequestHeaders.Clear(); client.DefaultRequestHeaders.Add("redHawkTokenUsername", redHawkToken.UserName); client.DefaultRequestHeaders.Add("redHawkTokenPassword", redHawkToken.Password); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); // var result = await client.PostAsJsonAsync("http://localhost:65023/api/Inbound/Update", inboundModel); var result = await client.PostAsJsonAsync <InboundModel>("http://localhost:65023/api/Inbound/Update", inboundModel); //Checking the response is successful or not which is sent using HttpClient if (result.IsSuccessStatusCode) { inboundModelListTemp.RemoveAll(info => info.CeaXmlId == inboundModel.CeaXmlId); Session["TabData"] = inboundModelListTemp; } } } else { return(RedirectToAction("Login", "Account")); } return(RedirectToAction("Index", "Home")); }