コード例 #1
0
        public ActionResult _Create(SBP_BlotterCRD BlotterCRD, 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)
                {
                    BlotterCRD.UserID         = Convert.ToInt16(Session["UserID"].ToString());
                    BlotterCRD.BID            = Convert.ToInt16(Session["BranchID"].ToString());
                    BlotterCRD.BR             = Convert.ToInt16(Session["BR"].ToString());
                    BlotterCRD.CurID          = Convert.ToInt16(Session["SelectedCurrency"].ToString());
                    BlotterCRD.CreateDate     = DateTime.Now;
                    BlotterCRD.Nostro_Account = Convert.ToInt32(form["Nostro_AccountId"].ToString());
                    ServiceRepository   serviceObj = new ServiceRepository();
                    HttpResponseMessage response   = serviceObj.PostResponse("api/BlotterCRD/InsertCRD", BlotterCRD);
                    response.EnsureSuccessStatusCode();
                    UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterCRD), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString());
                    return(RedirectToAction("BlotterCRD"));
                }
                else
                {
                    ViewBag.CRDNostroBanks = GetAllNostroBanks();
                }
            }
            catch (Exception ex) { }

            return(PartialView("_Create", BlotterCRD));
        }
コード例 #2
0
        public ActionResult Create()
        {
            SBP_BlotterCRD model = new SBP_BlotterCRD();

            try
            {
                UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), "", this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString());

                var ActiveAction     = RouteData.Values["action"].ToString();
                var ActiveController = RouteData.Values["controller"].ToString();
                Session["ActiveAction"]     = ActiveController;
                Session["ActiveController"] = ActiveAction;

                if (ModelState.IsValid)
                {
                    model.CreateDate = DateTime.Now.Date;

                    ViewBag.CRDNostroBanks = GetAllNostroBanks();
                }
            }
            catch (Exception ex) { }

            return(PartialView("_Create", model));
        }