public ActionResult MasterFormcreates(string formName, string FormWorkFlow_1, FormCollection form) { var appSettings = form.AllKeys.Where(k => k.StartsWith("AppSettings.")).ToDictionary(k => k, k => form[k]); Dictionary <string, object> forma = new Dictionary <string, object>(); form.CopyTo(forma); TextBoxList textList = new TextBoxList(); foreach (String key in form.AllKeys) { if (key != "FormWorkFlow_1") { TextBoxViewModel textBoxList1 = new TextBoxViewModel(); textBoxList1.FieldId = key; textBoxList1.Value = form[key]; textList.Add(textBoxList1); } } RelianceController.FormFieldController formFieldController = new RelianceController.FormFieldController(); TextBoxViewModel textBoxList = formFieldController.InsertMetada(formName, "", textList); MasterDocumentDo masterDocumentDo = new MasterDocumentDo(); masterDocumentDo.Formid = Convert.ToInt32(TempData["Dataid"]); if (FormWorkFlow_1 != "0") { masterDocumentDo.docid = textBoxList.IdentityId; masterDocumentDo.Formid = Convert.ToInt32(TempData["Dataid"]); masterDocumentDo.UserId = Convert.ToInt32(Session["LOGGED_UserId"]); masterDocumentDo.RoleId = Convert.ToInt32(Session["LOGGED_ROLE"]); masterDocumentDo.FormName = formName; MasterDocumentController masterDocumentController = new MasterDocumentController(); masterDocumentController.AddMasterDocument(masterDocumentDo); } return(RedirectToAction("MasterFormcreate", "FormMaster", new { LinKType = masterDocumentDo.Formid })); }
private void SaveFormValuesToSettings(FormCollection collection) { ViewData["PostResult"] = Resources.SettingsSaved; var dictionary = new Dictionary <string, object>(); collection.CopyTo(dictionary); _settingsManager.SaveCurrent(dictionary); }
public ActionResult About(FormCollection formData) { Dictionary <string, object> form = new Dictionary <string, object>(); formData.CopyTo(form); object test = FormCollectToObj <PersonInfo>(formData); return(View()); }
public static TransactionResponse GetTransactionResponse(FormCollection form) { //Dictionary<string, string> inDictionary = form.AllKeys.ToDictionary(x=> x, v=> form[v]); Dictionary <string, object> inDictionary = new Dictionary <string, object>(); form.CopyTo(inDictionary); string inJson = JsonConvert.SerializeObject(inDictionary); TransactionResponse response = JsonConvert.DeserializeObject <TransactionResponse>(inJson); return(response); }
public ActionResult SelectPaymentMethod(string paymentmethod, CheckoutPaymentMethodModel model, FormCollection form) { // validation var storeId = _storeContext.CurrentStore.Id; var customer = _workContext.CurrentCustomer; var cart = customer.GetCartItems(ShoppingCartType.ShoppingCart, storeId); if (cart.Count == 0) { return(RedirectToRoute("ShoppingCart")); } if ((customer.IsGuest() && !_orderSettings.AnonymousCheckoutAllowed)) { return(new HttpUnauthorizedResult()); } // reward points if (_rewardPointsSettings.Enabled) { _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.UseRewardPointsDuringCheckout, model.UseRewardPoints, storeId); } // payment method if (String.IsNullOrEmpty(paymentmethod)) { return(PaymentMethod()); } var paymentMethodProvider = _paymentService.LoadPaymentMethodBySystemName(paymentmethod, true, storeId); if (paymentMethodProvider == null) { return(PaymentMethod()); } // save _genericAttributeService.SaveAttribute(customer, SystemCustomerAttributeNames.SelectedPaymentMethod, paymentmethod, storeId); // validate info if (!IsValidPaymentForm(paymentMethodProvider.Value, form)) { return(PaymentMethod()); } // save payment data so that the user must not re-enter it form.CopyTo(_httpContext.GetCheckoutState().PaymentData, true); return(RedirectToAction("Confirm")); }