Beispiel #1
0
        public ActionResult GetBankBranchView()
        {
            BankBranchModel model    = new BankBranchModel();
            var             BranchId = Request.QueryString["branchid"];

            try
            {
                Branchclient = new BankBranchServiceClient();
                BankBranchDto BBDto = Branchclient.GetById(BranchId != null ? Convert.ToInt32(BranchId) : 0);
                model.BranchId         = BBDto.BranchId;
                model.BaseBranchId     = BBDto.BaseBranchId;
                model.BranchAddress    = BBDto.BranchAddress;
                model.BranchContactNos = BBDto.BranchContactNos;
                model.BranchOfBank     = BBDto.BranchOfBank;
                model.CAId             = BBDto.CAId;
                model.Email1           = BBDto.Email1;
                model.Email2           = BBDto.Email2;

                model.FullDayBreakFromString = BBDto.FullDayBreakFrom != null?DateTime.ParseExact(BBDto.FullDayBreakFrom.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM"; //Convert.ToInt32(BBDto.FullDayBreakFrom.Value.ToString(@"hh")) < 12 ? BBDto.FullDayBreakFrom.Value.ToString(@"hh\:mm") + Space + AM : BBDto.FullDayBreakFrom.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.FullDayBreakToString = BBDto.FullDayBreakTo != null?DateTime.ParseExact(BBDto.FullDayBreakTo.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM";       // Convert.ToInt32(BBDto.FullDayBreakTo.Value.ToString(@"hh")) < 12 ? BBDto.FullDayBreakTo.Value.ToString(@"hh\:mm") + Space + AM : BBDto.FullDayBreakTo.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.FullDayTimeFromString = BBDto.FullDayTimeFrom != null?DateTime.ParseExact(BBDto.FullDayTimeFrom.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM";    //Convert.ToInt32(BBDto.FullDayTimeFrom.Value.ToString(@"hh")) < 12 ? BBDto.FullDayTimeFrom.Value.ToString(@"hh\:mm") + Space + AM : BBDto.FullDayTimeFrom.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.FullDayTimeToString = BBDto.FullDayTimeTo != null?DateTime.ParseExact(BBDto.FullDayTimeTo.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM";          //Convert.ToInt32(BBDto.FullDayTimeTo.Value.ToString(@"hh")) < 12 ? BBDto.FullDayTimeTo.Value.ToString(@"hh\:mm") + Space + AM : BBDto.FullDayTimeTo.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.HalfDayBreakFromString = BBDto.HalfDayBreakFrom != null?DateTime.ParseExact(BBDto.HalfDayBreakFrom.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM"; //Convert.ToInt32(BBDto.HalfDayBreakFrom.Value.ToString(@"hh")) < 12 ? BBDto.HalfDayBreakFrom.Value.ToString(@"hh\:mm") + Space + AM : BBDto.HalfDayBreakFrom.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.HalfDayBreakToString = BBDto.HalfDayBreakTo != null?DateTime.ParseExact(BBDto.HalfDayBreakTo.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM";       //Convert.ToInt32(BBDto.HalfDayBreakTo.Value.ToString(@"hh")) < 12 ? BBDto.HalfDayBreakTo.Value.ToString(@"hh\:mm") + Space + AM : BBDto.HalfDayBreakTo.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.HalfDayTimeFromString = BBDto.HalfDayTimeFrom != null?DateTime.ParseExact(BBDto.HalfDayTimeFrom.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM";    //Convert.ToInt32(BBDto.HalfDayTimeFrom.Value.ToString(@"hh")) < 12 ? BBDto.HalfDayTimeFrom.Value.ToString(@"hh\:mm") + Space + AM : BBDto.HalfDayTimeFrom.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.HalfDayTimeToString = BBDto.HalfDayTimeTo != null?DateTime.ParseExact(BBDto.HalfDayTimeTo.Value.ToString(@"hh\:mm"), "HH:mm", null).ToString("hh:mm tt", CultureInfo.GetCultureInfo("en-US")) : "00:00 AM";          //Convert.ToInt32(BBDto.HalfDayTimeTo.Value.ToString(@"hh")) < 12 ? BBDto.HalfDayTimeTo.Value.ToString(@"hh\:mm") + Space + AM : BBDto.HalfDayTimeTo.Value.ToString(@"hh\:mm") + Space + PM : "00:00 AM";

                model.IFSCCode      = BBDto.IFSCCode;
                model.MICRCode      = BBDto.MICRCode;
                model.Name          = BBDto.Name;
                model.SWIFTCode     = BBDto.SWIFTCode;
                model.WeeklyHalfDay = BBDto.WeeklyHalfDay;
                model.WeeklyOffDay  = BBDto.WeeklyOffDay;
            }
            catch (Exception ex)
            {
                return(View("ErrorPage"));
            }
            finally
            {
                if (Branchclient != null)
                {
                    Branchclient.Close();
                }
            }
            return(View("AckAndClientCommonViews\\BankBranchView", model));
        }
Beispiel #2
0
        public List <BankBranchDto> GetBankBranchList(int BankId)
        {
            UserDto currentUserDto = (UserDto)Session[Constants.SKCURRENTUSER];
            Query   subquery1      = new Query();

            if (Helper.IsCAIdNotNull(currentUserDto))
            {
                Criterion criteriaCAId = new Criterion(Constants.CAID, Helper.GetCAIdOfUser(currentUserDto), CriteriaOperator.Equal);
                subquery1.Add(criteriaCAId);
                Criterion criteriaCAIdNULL = new Criterion(Constants.CAID, null, CriteriaOperator.IsNullOrZero);
                subquery1.Add(criteriaCAIdNULL);
                subquery1.QueryOperator = QueryOperator.Or;
            }
            else
            {
                Criterion criteriaCAIdNULL = new Criterion(Constants.CAID, null, CriteriaOperator.IsNullOrZero);
                subquery1.Add(criteriaCAIdNULL);
            }

            Query query = new Query();

            if (Helper.IsCAIdNotNull(currentUserDto))
            {
                query.CAId = Convert.ToInt32(Helper.GetCAIdOfUser(currentUserDto));
            }
            Criterion criteriaBankId = new Criterion("banks.BankId", BankId, CriteriaOperator.Equal);

            query.Add(criteriaBankId);
            query.AddAlias(new Alias("banks", "BranchOfBank"));
            query.QueryOperator = QueryOperator.And;
            query.AddSubQuery(subquery1);

            Branchclient = new BankBranchServiceClient();
            var BankBranches = Branchclient.FindByQuery(query);

            Branchclient.Close();
            return(BankBranches.Entities.ToList());
        }
        ////function to check wheather chequeDate is greater than 6 months from current date
        //public bool CheckChequeDate(string chequeDate)
        //{
        //    DateTime chequeDDTransactionDate;
        //    double totalDays;
        //    bool isChequeDateGreaterThanSixMonths=false;
        //    if(!string.IsNullOrEmpty(chequeDate))
        //    {
        //        DateTimeFormatInfo dateTimeFormatInfo = new DateTimeFormatInfo();
        //        dateTimeFormatInfo.ShortDatePattern = "dd-MM-yyyy";
        //        dateTimeFormatInfo.DateSeparator = "-";
        //        chequeDDTransactionDate = Convert.ToDateTime(chequeDate, dateTimeFormatInfo);
        //        totalDays = chequeDDTransactionDate.Subtract(DateTime.Now).TotalDays;
        //        if(totalDays >90)
        //        {
        //            isChequeDateGreaterThanSixMonths = true;
        //        }
        //    }
        //    return isChequeDateGreaterThanSixMonths;
        //}
        #endregion

        #region SearchBankandBranch
        public ActionResult SearchBankandBranch()
        {
            bool   flag       = false;
            string bankName   = Request.Params["bankName"];
            string bankBranch = Request.Params["bankBranch"];
            string place      = Request.Params["place"];
            string IFSCCode   = Request.Params["IFSCCode"];
            string MICRCode   = Request.Params["MICRCode"];
            string SWIFTCode  = Request.Params["SWIFTCode"];

            BankBranchServiceReference.BankBranchServiceClient bankBranchServiceClient = new BankBranchServiceClient();
            IList <BankBranchDto> bankBranchDtoList = null;
            Query query = new Query();

            if (!string.IsNullOrEmpty(bankName))
            {
                flag = true;
                Criterion criterionBankName = new Criterion("BranchBank.BankName", bankName, CriteriaOperator.Equal);
                query.AddAlias(new Alias("BranchBank", "BranchOfBank"));
                query.Add(criterionBankName);
            }
            if (!string.IsNullOrEmpty(bankBranch))
            {
                flag = true;
                Criterion criterionBranchName = new Criterion("Name", bankBranch, CriteriaOperator.Equal);
                query.Add(criterionBranchName);
            }
            if (!string.IsNullOrEmpty(place))
            {
                flag = true;
                Criterion criterionplace = new Criterion("cv.Name", place, CriteriaOperator.Equal);
                query.AddAlias(new Alias("ba", "BranchAddress"));
                query.AddAlias(new Alias("cv", "ba.CityVillage"));
                query.Add(criterionplace);
            }
            if (!string.IsNullOrEmpty(IFSCCode))
            {
                flag = true;
                Criterion criterionIFSCCode = new Criterion("IFSCCode", IFSCCode, CriteriaOperator.Equal);
                query.Add(criterionIFSCCode);
            }
            if (!string.IsNullOrEmpty(MICRCode))
            {
                flag = true;
                Criterion criterionMICRCode = new Criterion("MICRCode", MICRCode, CriteriaOperator.Equal);
                query.Add(criterionMICRCode);
            }
            if (!string.IsNullOrEmpty(SWIFTCode))
            {
                flag = true;
                Criterion criterionSWIFTCode = new Criterion("SWIFTCode", SWIFTCode, CriteriaOperator.Equal);
                query.Add(criterionSWIFTCode);
            }
            if (flag)
            {
                query.QueryOperator = QueryOperator.And;
                bankBranchDtoList   = bankBranchServiceClient.FindByQuery(query).Entities;
                bankBranchServiceClient.Close();
                ViewData["SearchBank"] = bankBranchDtoList;
            }
            else
            {
                ViewData["SearchBank"] = null;
            }
            return(PartialView("CBPPopupSearchBankBranchGrid", ViewData["SearchBank"]));
        }