public ActionResult Create(FormCollection form) { #region Added by shakir (Currency parameter) var selectCurrency = (dynamic)null; if (form["selectCurrency"] != null) { selectCurrency = Convert.ToInt32(form["selectCurrency"].ToString()); } else { selectCurrency = Convert.ToInt32(Session["SelectedCurrency"].ToString()); } UtilityClass.GetSelectedCurrecy(selectCurrency); #endregion SBP_BlotterCRRFINCON model = new SBP_BlotterCRRFINCON(); try { if (ModelState.IsValid) { model.CreateDate = DateTime.Now.Date; } } catch (Exception ex) { } return(PartialView("_Create", model)); }
public ActionResult Create() { var ActiveAction = RouteData.Values["action"].ToString(); var ActiveController = RouteData.Values["controller"].ToString(); Session["ActiveAction"] = ActiveController; Session["ActiveController"] = ActiveAction; UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), "", this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); SBP_BlotterCRRFINCON model = new SBP_BlotterCRRFINCON(); try { if (ModelState.IsValid) { model.CreateDate = DateTime.Now.Date; } } catch (Exception ex) { } return(PartialView("_Create", model)); }
public ActionResult _Create(SBP_BlotterCRRFINCON BlotterCRRFINCON, FormCollection form) { try { #region Added by shakir (Currency parameter) var selectCurrency = (dynamic)null; if (form["selectCurrency"] != null) { selectCurrency = Convert.ToInt32(form["selectCurrency"].ToString()); } else { selectCurrency = Convert.ToInt32(Session["SelectedCurrency"].ToString()); } UtilityClass.GetSelectedCurrecy(selectCurrency); #endregion if (ModelState.IsValid) { BlotterCRRFINCON.UserID = Convert.ToInt16(Session["UserID"].ToString()); BlotterCRRFINCON.BID = Convert.ToInt16(Session["BranchID"].ToString()); BlotterCRRFINCON.BR = Convert.ToInt16(Session["BR"].ToString()); BlotterCRRFINCON.CurID = Convert.ToInt16(Session["SelectedCurrency"].ToString()); BlotterCRRFINCON.CreateDate = DateTime.Now; UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterCRRFINCON), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString()); ServiceRepository serviceObj = new ServiceRepository(); HttpResponseMessage response = serviceObj.PostResponse("api/BlotterCRRFINCON/InsertCRRFINCON", BlotterCRRFINCON); response.EnsureSuccessStatusCode(); return(RedirectToAction("BlotterCRRFINCON")); } } catch (Exception ex) { } return(PartialView("_Create", BlotterCRRFINCON)); }