Example #1
0
 public JsonResult InsertWOAllotmentDetails(AllotmentDetails allotmentDetails)
 {
     System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
     System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
     log.Debug("Start: " + methodBase.Name);
     try
     {
         int checkSession = UserLogin.AuthenticateRequest();
         if (checkSession == 0)
         {
             return Json(checkSession);
         }
         else
         {
             int createdBy = Convert.ToInt32(Session["UserID"]);
             int result = AllotmentDetails.InsertWOAllotmentDetails(allotmentDetails, createdBy);
             return Json(result);
         }
     }
     catch (Exception ex)
     {
         log.Error("Error: " + ex);
         return Json("");
     }
     finally
     {
         log.Debug("End: " + methodBase.Name);
     }
 }
 private AllotmentDetails FetchWOAllot(AllotmentDetails WOAllotData, SafeDataReader dr)
 {
     WOAllotData.WOID = dr.GetInt32("WOID");
     WOAllotData.ReturnOfAllotmentOfShares = dr.GetInt32("ReturnOfAllotmentOfShares");
     WOAllotData.Currency = dr.GetInt32("Currency");
     WOAllotData.ClassOfShare = dr.GetInt32("ClassOfShare");
     WOAllotData.NumberOfNewSharesToBeAllotted = dr.GetString("NumberOfNewSharesToBeAllotted");
     WOAllotData.ConsiderationOfEachShare = dr.GetString("ConsiderationOfEachShare");
     WOAllotData.AmountToBeTreatedAsPaidOnEachShare = dr.GetString("AmountToBeTreatedAsPaidOnEachShare");
     WOAllotData.TotalConsideration = dr.GetString("TotalConsideration");
     WOAllotData.ResultantTotalNoOfIssuedShares = dr.GetString("ResultantTotalNoOfIssuedShares");
     WOAllotData.ResultantIssuedCapital = dr.GetString("ResultantIssuedCapital");
     WOAllotData.ResultantPaidUpCapital = dr.GetString("ResultantPaidUpCapital");
     WOAllotData.MeetingNotice = dr.GetInt32("MeetingNotice");
     WOAllotData.MeetingNoticeSource = dr.GetString("MeetingNoticeSource");
     WOAllotData.MeetingMinutes = dr.GetInt32("MeetingMinutes");
     WOAllotData.MeetingMinutesSource = dr.GetString("MeetingMinutesSource");
     WOAllotData.OtherMeetingMinutes = dr.GetString("OtherMeetingMinutes");
     WOAllotData.Designation = dr.GetString("DesignationOfThePersonSigningTheAllotment");
     WOAllotData.NoticeOfResolution = dr.GetInt32("NoticeOfResolution");
     WOAllotData.NoticeOfResolutionSource = dr.GetString("NoticeOfResolutionSource");
     WOAllotData.F24F25 = dr.GetInt32("F24F25");
     WOAllotData.F24F25Source = dr.GetString("F24F25Source");
     WOAllotData.ShareholdingStructure = dr.GetInt32("ShareholdingStructure");
     WOAllotData.IsROPlaceOfMeeting = dr.GetBoolean("IsROPlaceOfMeeting");
     WOAllotData.MAddressLine1 = dr.GetString("MeetingAddressLine1");
     WOAllotData.MAddressLine2 = dr.GetString("MeetingAddressLine2");
     WOAllotData.MAddressLine3 = dr.GetString("MeetingAddressLine3");
     WOAllotData.MAddressCountry = dr.GetInt32("MAddressCountry");
     WOAllotData.MAddressPostalCode = dr.GetString("MPostalCode");
     return WOAllotData;
 }
        /// <summary>
        /// Description  : To Get Work Order INCorpDetails.
        /// Created By   : Sudheer  
        /// Created Date : 30 July 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static AllotmentDetails GetWOAllotmentDetails(string WOID)
        {
            var WOAllotData = new AllotmentDetails();

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[1];
                sqlParams[0] = new SqlParameter("@WOID", WOID);
                var reader = SqlHelper.ExecuteReader(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "[SpGetWOAllotmentDetails]", sqlParams);
                var safe = new SafeDataReader(reader);
                while (reader.Read())
                {
                    WOAllotData.FetchWOAllot(WOAllotData, safe);
                }

                return WOAllotData;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return WOAllotData;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
        /// <summary>
        /// Description  : To Insert Work Order WOAllotmentDetails.
        /// Created By   : Sudheer  
        /// Created Date : 4th Aug 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns></returns>
        public static int InsertWOAllotmentDetails(AllotmentDetails WOAlloatDetails, int CreatedBy)
        {
            int output = -2;

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                SqlParameter[] sqlParams = new SqlParameter[29];

                sqlParams[0] = new SqlParameter("@CreatedBy", CreatedBy);
                sqlParams[1] = new SqlParameter("@WOID", WOAlloatDetails.WOID);
                sqlParams[2] = new SqlParameter("@ReturnOfAllotmentOfShares", WOAlloatDetails.ReturnOfAllotmentOfShares);
                sqlParams[3] = new SqlParameter("@Currency", WOAlloatDetails.Currency);
                sqlParams[4] = new SqlParameter("@ClassOfShare", WOAlloatDetails.ClassOfShare);
                sqlParams[5] = new SqlParameter("@NumberOfNewSharesToBeAllotted", WOAlloatDetails.NumberOfNewSharesToBeAllotted);
                sqlParams[6] = new SqlParameter("@ConsiderationOfEachShare", WOAlloatDetails.ConsiderationOfEachShare);
                sqlParams[7] = new SqlParameter("@AmountToBeTreatedAsPaidOnEachShare", WOAlloatDetails.AmountToBeTreatedAsPaidOnEachShare);
                sqlParams[8] = new SqlParameter("@TotalConsideration", WOAlloatDetails.TotalConsideration);
                sqlParams[9] = new SqlParameter("@ResultantTotalNoOfIssuedShares", WOAlloatDetails.ResultantTotalNoOfIssuedShares);
                sqlParams[10] = new SqlParameter("@ResultantIssuedCapital", WOAlloatDetails.ResultantIssuedCapital);
                sqlParams[11] = new SqlParameter("@ResultantPaidUpCapital", WOAlloatDetails.ResultantPaidUpCapital);
                sqlParams[12] = new SqlParameter("@MeetingNotice", WOAlloatDetails.MeetingNotice);
                sqlParams[13] = new SqlParameter("@MeetingNoticeSource", WOAlloatDetails.MeetingNoticeSource);
                sqlParams[14] = new SqlParameter("@MeetingMinutes", WOAlloatDetails.MeetingMinutes);
                sqlParams[15] = new SqlParameter("@MeetingMinutesSource", WOAlloatDetails.MeetingMinutesSource);
                sqlParams[16] = new SqlParameter("@DesignationOfThePersonSigningTheAGM", WOAlloatDetails.Designation);
                sqlParams[17] = new SqlParameter("@NoticeOfResolution", WOAlloatDetails.NoticeOfResolution);
                sqlParams[18] = new SqlParameter("@NoticeOfResolutionSource", WOAlloatDetails.NoticeOfResolutionSource);
                sqlParams[19] = new SqlParameter("@F24F25", WOAlloatDetails.F24F25);
                sqlParams[20] = new SqlParameter("@F24F25Source", WOAlloatDetails.F24F25Source);
                sqlParams[21] = new SqlParameter("@ShareholdingStructure", WOAlloatDetails.ShareholdingStructure);
                sqlParams[22] = new SqlParameter("@OtherMeetingMinutes", WOAlloatDetails.OtherMeetingMinutes);
                sqlParams[23] = new SqlParameter("@IsROPlaceOfMeeting", WOAlloatDetails.IsROPlaceOfMeeting);
                sqlParams[24] = new SqlParameter("@MeetingAddressLine1", WOAlloatDetails.MAddressLine1);
                sqlParams[25] = new SqlParameter("@MeetingAddressLine2", WOAlloatDetails.MAddressLine2);
                sqlParams[26] = new SqlParameter("@MeetingAddressLine3", WOAlloatDetails.MAddressLine3);
                sqlParams[27] = new SqlParameter("@MAddressCountry", WOAlloatDetails.MAddressCountry);
                sqlParams[28] = new SqlParameter("@MPostalCode", WOAlloatDetails.MAddressPostalCode);

                output = SqlHelper.ExecuteNonQuery(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpInsertOrUpdateWOAllotmentDetails", sqlParams);
                return output;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return output;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }
        /// <summary>
        /// Description  : To Save All WOInterimDividend Details.
        /// Created By   : Shiva  
        /// Created Date : 22 Aug 2014
        /// Modified By  :
        /// Modified Date:
        /// </summary>
        /// <returns>WOInterimDividend Saved status.</returns>
        public int SaveWoInterimDividendDetails()
        {
            int SavedStatus = -2;

            System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame();
            System.Reflection.MethodBase methodBase = stackFrame.GetMethod();
            log.Debug("Start: " + methodBase.Name);
            try
            {
                var WOAllotData = new AllotmentDetails();

                SqlParameter[] sqlParams = new SqlParameter[8];
                sqlParams[0] = new SqlParameter("@WOID", this.WOID);
                sqlParams[1] = new SqlParameter("@FinancialPeriod", HelperClasses.ConvertDateFormat(this.FinancialPeriod));
                //sqlParams[2] = new SqlParameter("@ClassOfShare", DBNull.Value);
                // sqlParams[3] = new SqlParameter("@DividendPerShare", this.DividendPerShare);
                //  sqlParams[5] = new SqlParameter("@TotalAmount", this.TotalAmount);
                sqlParams[2] = new SqlParameter("@DateOfDeclaration", HelperClasses.ConvertDateFormat(this.DateOfDeclaration));
                sqlParams[3] = new SqlParameter("@DateOfPayment", HelperClasses.ConvertDateFormat(this.DateOfPayment));
                sqlParams[4] = new SqlParameter("@DividendDirector", this.DividendDirector);
                sqlParams[5] = new SqlParameter("@DividendSource", this.DividendSource);
                sqlParams[6] = new SqlParameter("@SavedBy", this.SavedBy);
                // sqlParams[11] = new SqlParameter("@TotalShares", this.TotalShares);
                SavedStatus = SqlHelper.ExecuteNonQuery(ConnectionUtility.GetConnectionString(), CommandType.StoredProcedure, "SpSaveWOInterimDividendDetails", sqlParams);
                return SavedStatus;
            }
            catch (Exception ex)
            {
                log.Error("Error: " + ex);
                return SavedStatus;
            }
            finally
            {
                log.Debug("End: " + methodBase.Name);
            }
        }