public JsonResult TransferBalance(SecurityTransferLogModel objSecurityTransferLogModel)
        {
            LoginUserDetails    objLoginUserDetails    = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails);
            SecurityTransferDTO objSecurityTransferDTO = new SecurityTransferDTO();

            try
            {
                Common.Common.CopyObjectPropertyByName(objSecurityTransferLogModel, objSecurityTransferDTO);

                using (var objSecurityTransferSL = new SecurityTransferSL())
                {
                    objSecurityTransferSL.TransferBalance(objLoginUserDetails.CompanyDBConnectionString, objSecurityTransferDTO);
                }
                return(Json(new
                {
                    status = true,
                    msg = Common.Common.getResource("usr_msg_11471")
                }));
            }
            catch (Exception exp)
            {
                if (ModelState.ContainsKey("TransferQuantity"))
                {
                    ModelState["TransferQuantity"].Errors.Clear();
                }
                ModelState.AddModelError("Error", Common.Common.GetErrorMessage(exp));
                return(Json(new { status = false, error = ModelState.ToSerializedDictionary() }));
            }
            finally
            {
                objLoginUserDetails = null;
            }
        }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="i_sConnectionString"></param>
 /// <param name="objSecurityTransferDTO"></param>
 /// <returns></returns>
 public InsiderTradingDAL.SecurityTransferDTO TransferBalance(string i_sConnectionString, SecurityTransferDTO objSecurityTransferDTO)
 {
     try
     {
         using (var objSecurityTransferDAL = new SecurityTransferDAL())
         {
             return(objSecurityTransferDAL.TransferBalance(i_sConnectionString, objSecurityTransferDTO));
         }
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }