Exemplo n.º 1
0
        public ActionResult _Create(SBP_BlotterTBO BlotterTBO, 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)
                {
                    BlotterTBO.TBO_OutFLow = UC.CheckNegativeValue(BlotterTBO.TBO_OutFLow);
                    BlotterTBO.UserID      = Convert.ToInt16(Session["UserID"].ToString());
                    BlotterTBO.BR          = Convert.ToInt16(Session["BR"].ToString());
                    BlotterTBO.BID         = Convert.ToInt16(Session["BranchID"].ToString());
                    BlotterTBO.CurID       = Convert.ToInt16(Session["SelectedCurrency"].ToString());
                    BlotterTBO.CreateDate  = DateTime.Now;
                    ServiceRepository   serviceObj = new ServiceRepository();
                    HttpResponseMessage response   = serviceObj.PostResponse("api/BlotterTBO/InsertTBO", BlotterTBO);
                    response.EnsureSuccessStatusCode();
                    //ViewData["SysCurrentDt"] = GetCurrentDT().ToString("dd-MMM-yyyy");
                    // ViewData["BrCode"] = BrCode;
                    UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterTBO), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString());
                    return(RedirectToAction("BlotterTBO"));
                }
                else
                {
                    ViewBag.TBOTransactionTitles = GetAllTBOTransactionTitles();
                }
            }
            catch (Exception ex) { }
            return(PartialView("_Create", BlotterTBO));
        }
        public ActionResult _Create(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
                List <SBP_BlotterOutRight> BlotterOR = new List <SBP_BlotterOutRight>();
                for (int i = 0; i <= Request.Form.Count; i++)
                {
                    if (Request.Form["Broker[" + i + "]"] != null)
                    {
                        var DataType_data   = (Session["BR"].ToString() != "01") ? Request.Form["DataType[" + i + "]"] : "SBP";
                        var Bank_data       = Request.Form["Bank[" + i + "]"];
                        var Rate_data       = Convert.ToDouble(Request.Form["Rate[" + i + "]"]);
                        var Broker_data     = Request.Form["Broker[" + i + "]"];
                        var Issue_Date_data = Request.Form["Issue_Date[" + i + "]"];
                        var IssueType_data  = Request.Form["IssueType[" + i + "]"];
                        var InFlow_data     = Convert.ToDecimal(Request.Form["InFlow[" + i + "]"]);
                        var OutFLow_data    = UC.CheckNegativeValue(Convert.ToDecimal(Request.Form["OutFLow[" + i + "]"]));
                        var Note_data       = Request.Form["Note[" + i + "]"];

                        BlotterOR.Add(new SBP_BlotterOutRight
                        {
                            DataType   = DataType_data,
                            Bank       = Bank_data,
                            Rate       = Rate_data,
                            Broker     = Broker_data,
                            Issue_Date = Convert.ToDateTime(Issue_Date_data.ToString()),
                            IssueType  = IssueType_data,
                            InFlow     = InFlow_data,
                            OutFLow    = OutFLow_data,
                            Note       = Note_data,
                            UserID     = Convert.ToInt16(Session["UserID"].ToString()),
                            BID        = Convert.ToInt16(Session["BranchID"].ToString()),
                            BR         = Convert.ToInt16(Session["BR"].ToString()),
                            CurID      = Convert.ToInt16(Session["SelectedCurrency"].ToString()),
                            CreateDate = DateTime.Now,
                            Date       = DateTime.Now,
                            Status     = true
                        });
                    }
                }


                if (ModelState.IsValid)
                {
                    ServiceRepository   serviceObj = new ServiceRepository();
                    HttpResponseMessage response   = serviceObj.PostResponse("api/BlotterOutRight/InsertOutRight", BlotterOR);
                    response.EnsureSuccessStatusCode();
                    UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterOR), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString());
                    return(RedirectToAction("BlotterOutRight"));
                }
            }
            catch (Exception ex)
            {
            }


            return(PartialView("_Create"));
        }
        public ActionResult _Create(SBP_BlotterBreakups BlotterBreakups, 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)
                {
                    BlotterBreakups.CashWithdrawbySBPCheques_outFlow = UC.CheckNegativeValue(BlotterBreakups.CashWithdrawbySBPCheques_outFlow);
                    BlotterBreakups.ERF_outflow                     = UC.CheckNegativeValue(BlotterBreakups.ERF_outflow);
                    BlotterBreakups.DSC_outFlow                     = UC.CheckNegativeValue(BlotterBreakups.DSC_outFlow);
                    BlotterBreakups.RemitanceToHOK_outFlow          = UC.CheckNegativeValue(BlotterBreakups.RemitanceToHOK_outFlow);
                    BlotterBreakups.SBPCheqGivenToOtherBank_outFlow = UC.CheckNegativeValue(BlotterBreakups.SBPCheqGivenToOtherBank_outFlow);
                    BlotterBreakups.Miscellaneous_outflow           = UC.CheckNegativeValue(BlotterBreakups.Miscellaneous_outflow);
                    BlotterBreakups.UserID      = Convert.ToInt16(Session["UserID"].ToString());
                    BlotterBreakups.BR          = Convert.ToInt16(Session["BR"].ToString());
                    BlotterBreakups.BID         = Convert.ToInt16(Session["BranchID"].ToString());
                    BlotterBreakups.CurID       = Convert.ToInt16(Session["SelectedCurrency"].ToString());
                    BlotterBreakups.BreakupDate = DateTime.Now;
                    BlotterBreakups.CreateDate  = DateTime.Now;
                    UtilityClass.ActivityMonitor(Convert.ToInt32(Session["UserID"]), Session.SessionID, Request.UserHostAddress.ToString(), new Guid().ToString(), JsonConvert.SerializeObject(BlotterBreakups), this.RouteData.Values["action"].ToString(), Request.RawUrl.ToString());
                    ServiceRepository   serviceObj = new ServiceRepository();
                    HttpResponseMessage response   = serviceObj.PostResponse("api/BlotterBreakups/InsertBlotterBreakups", BlotterBreakups);
                    response.EnsureSuccessStatusCode();
                    return(RedirectToAction("BlotterBreakups"));
                }
            }
            catch (Exception ex) { }

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