示例#1
0
        public CommonDbResponse GetNwscBill(NwscBillInquiryCommon billinq)
        {
            CommonDbResponse            response = new CommonDbResponse();
            Dictionary <string, string> Data     = new Dictionary <string, string>();

            Data.Add("CustomerId", billinq.CustomerId);
            Data.Add("OfficeCode", billinq.OfficeCode);
            Data.Add("UserId", billinq.UserId);
            Data.Add("IpAddress", billinq.IpAddress);
            GatewaySwitchAbstractService factory = GatewaySwitchAbstractFactory.Create("cgpay");

            var fresponse = factory.GetUserDetails("34", Data);

            response.Message     = fresponse.Message;
            response.GatewayName = fresponse.GatewayName;
            if (fresponse.Code == "000")
            {
                response.Code = ResponseCode.Success;
                response.Data = fresponse.Data;
            }
            else
            {
                response.Code = ResponseCode.Failed;
            }
            return(response);
        }
示例#2
0
        public ActionResult NwscBillInquiry(NwscBillInquiryModel nwsc)
        {
            NwscBillInquiryCommon nbc = nwsc.MapObject <NwscBillInquiryCommon>();

            ViewBag.branchlist = ApplicationUtilities.SetDDLValue(Denomination("34"), "", "--Select Office--");
            var productdetails = GetNWSCproductDetails();

            nwsc.ProductLogo = productdetails.ProductLogo;


            nbc.IpAddress = ApplicationUtilities.GetIP();
            nbc.UserId    = ApplicationUtilities.GetSessionValue("userid").ToString();

            var inquiry = _nwsc.GetNwscBill(nbc);
            NwscBillInquiryResponseModel nwspbillresp = new NwscBillInquiryResponseModel();

            if (inquiry.GatewayName.ToUpper() == "PRABHUPAY")
            {
                if (inquiry.Code == shared.Models.ResponseCode.Success)
                {
                    var obj = Newtonsoft.Json.JsonConvert.SerializeObject(inquiry.Data);
                    var prabhupayinqresp = Newtonsoft.Json.JsonConvert.DeserializeObject <PrabhuPayNwscBillInquiryResponseModel>(obj);
                    nwspbillresp.CustomerId         = prabhupayinqresp.CustomerId;
                    nwspbillresp.CustomerName       = prabhupayinqresp.CustomerName;
                    nwspbillresp.Area               = prabhupayinqresp.Area;
                    nwspbillresp.Lagat              = prabhupayinqresp.Lagat;
                    nwspbillresp.OfficeCode         = prabhupayinqresp.OfficeCode;
                    nwspbillresp.Office             = prabhupayinqresp.Office;
                    nwspbillresp.TotalDueAmount     = prabhupayinqresp.TotalDueAmount;
                    nwspbillresp.TotalServiceCharge = prabhupayinqresp.TotalServiceCharge;
                    List <NwscBillInquiryDetailModel> lst = new List <NwscBillInquiryDetailModel>();
                    foreach (var item in prabhupayinqresp.BillDetail)
                    {
                        NwscBillInquiryDetailModel bill = new NwscBillInquiryDetailModel()
                        {
                            BillFrom       = item.BillFrom,
                            BillTo         = item.BillTo,
                            BillAmount     = item.BillAmount,
                            FineAmount     = item.FineAmount,
                            MeterRent      = item.MeterRent,
                            DiscountAmount = item.DiscountAmount,
                            PayableAmount  = item.PayableAmount,
                        };
                        lst.Add(bill);
                    }
                    nwspbillresp.BillDetail       = lst;
                    nwspbillresp.EncryptedContent = (prabhupayinqresp.TotalDueAmount + prabhupayinqresp.TotalServiceCharge + prabhupayinqresp.CustomerId + prabhupayinqresp.OfficeCode).EncryptParameter();
                    return(View("NwscBillPayment", nwspbillresp));
                }
                else
                {
                    this.ShowPopup(1, inquiry.Message);
                    return(View(nwsc));
                }
            }
            this.ShowPopup(1, "Service Unavaliable");
            return(View(nwsc));
        }
 public CommonDbResponse GetNwscBill(NwscBillInquiryCommon billinq)
 {
     return(repo.GetNwscBill(billinq));
 }