Beispiel #1
0
        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_BlotterManualEstBalance model = new SBP_BlotterManualEstBalance();

            ViewData["BR"] = Session["BR"].ToString();
            return(PartialView("_Create", model));
        }
Beispiel #2
0
        public ActionResult _Create(SBP_BlotterManualEstBalance BlotterEstAdjBal, 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)
                {
                    if (Session["BR"].ToString() == "01")
                    {
                        BlotterEstAdjBal.DataType = "SBP";
                    }
                    BlotterEstAdjBal.AdjDate    = BlotterEstAdjBal.AdjDate;
                    BlotterEstAdjBal.isAdjusted = true;
                    BlotterEstAdjBal.UserID     = Convert.ToInt16(Session["UserID"].ToString());
                    BlotterEstAdjBal.BID        = Convert.ToInt16(Session["BranchID"].ToString());
                    BlotterEstAdjBal.BR         = Convert.ToInt16(Session["BR"].ToString());
                    BlotterEstAdjBal.CurID      = Convert.ToInt16(Session["SelectedCurrency"].ToString());
                    BlotterEstAdjBal.CreateDate = DateTime.Now;
                    ServiceRepository   serviceObj = new ServiceRepository();
                    HttpResponseMessage response   = serviceObj.PostResponse("api/BlotterManualDeals/InsertEstAdjBal", BlotterEstAdjBal);
                    response.EnsureSuccessStatusCode();
                    UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterEstAdjBal), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString());
                    return(RedirectToAction("EstimatedAdjustedBalance"));
                }
            }
            catch (Exception ex) { }
            return(PartialView("_Create", BlotterEstAdjBal));
        }