コード例 #1
0
        /// <summary>
        /// Add DC Claim Details
        /// </summary>
        /// <param name="objDCClaim"></param>
        /// <returns></returns>
        public DataTable SavePCClaim(PharmacyClaimRequest objPClaim)
        {
            objBLLPClaim.SpType              = 1;
            objBLLPClaim.Token               = objPClaim.Token;
            objBLLPClaim.TPC_ClaimClient     = objPClaim.TPC_ClaimClient;
            objBLLPClaim.TPC_PolicyNumber    = objPClaim.TPC_PolicyNumber;
            objBLLPClaim.TPC_Document        = objPClaim.TPC_ClaimClient;
            objBLLPClaim.TPC_PatientName     = objPClaim.TPC_PatientName;
            objBLLPClaim.TPC_MemberCode      = objPClaim.TPC_MemberCode;
            objBLLPClaim.TPC_PatientMobile   = objPClaim.TPC_PatientMobile;
            objBLLPClaim.TPC_AppointmentDate = objPClaim.TPC_AppointmentDate;
            objBLLPClaim.TPC_ID              = objPClaim.TPC_ID;
            objBLLPClaim.TPC_Name            = objPClaim.TPC_Name;
            objBLLPClaim.IP = objPClaim.IP;
            objBLLPClaim.TPC_ClaimedAmount = objPClaim.TPC_ClaimedAmount;
            objBLLPClaim.TPC_ARRemarks     = objPClaim.TPC_ARRemarks;
            objBLLPClaim.TPC_MedicineName  = "";
            objBLLPClaim.TPC_MRP           = "";
            objBLLPClaim.TPC_QTY           = "";
            objBLLPClaim.TPC_SellingPrice  = "";
            foreach (var item in objPClaim.PharmacyClaimDetail)
            {
                objBLLPClaim.TPC_MedicineName += item.TPC_MedicineName + "|";
                objBLLPClaim.TPC_QTY          += item.TPC_QTY + "|";
                objBLLPClaim.TPC_SellingPrice += item.TPC_SellingPrice + "|";
            }
            DataSet objds = objBLLPClaim.ExecuteDataset(objBLLPClaim);

            return(objds.Tables[0]);
        }
コード例 #2
0
        public string SavePCClaim([FromBody]  PharmacyClaimRequest objPC)
        {
            int flag = 0;

            try
            {
                getDatatable();
                objPC.Token = HttpContext.Current.Request.Headers["Token"].ToString();
                objPC.IP    = HttpContext.Current.Request.UserHostAddress;
                if (string.IsNullOrEmpty(objPC.TPC_ClaimClient))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide ClientId";
                }
                /// Policy Number
                else if (string.IsNullOrEmpty(objPC.TPC_PolicyNumber))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Policy Number";
                }
                //CheckIs Policy Valid
                else if (!objDoctorClaimService.CheckIsPolicyValid(objPC.TPC_PolicyNumber))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-100"; dt.Rows[0]["Message"] = "Invalid Policy";
                }
                ///Client Id
                else if (!(objDoctorClaimService.GetClientCode(objPC.TPC_PolicyNumber) == objPC.TPC_ClaimClient))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-105"; dt.Rows[0]["Message"] = "Invalid Client Id";
                }
                /// Member Code
                else if (string.IsNullOrEmpty(objPC.TPC_MemberCode))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Member Code";
                }

                /// Patient Name
                else if (string.IsNullOrEmpty(objPC.TPC_PatientName))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Patient Name";
                }
                ///Patient Age

                else if (string.IsNullOrEmpty(objPC.TPC_PatientMobile))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Mobile Number";
                }
                ///Appointment Date
                else if (string.IsNullOrEmpty(objPC.TPC_AppointmentDate))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Medicine Provide Date";
                }
                ///DoctorId
                else if (objPC.TPC_ID == 0)
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Pharmacy ID";
                }
                ///Doctor Name
                else if (string.IsNullOrEmpty(objPC.TPC_Name))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Pharmacy Name";
                }
                ///DC_ClaimedAmount
                else if (string.IsNullOrEmpty(objPC.TPC_ClaimedAmount))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-110"; dt.Rows[0]["Message"] = "Please Provide Claimed Amount";
                }

                else if (objPC.TPC_ClaimedAmount == "0")
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-106"; dt.Rows[0]["Message"] = "Claimed Amount Cannot be 0";
                }
                //DocumentUrl

                ///Check IsPolicy MemberValid
                else if (!objDoctorClaimService.CheckIsPolicyMemberValid(objPC.TPC_PolicyNumber, objPC.TPC_MemberCode))
                {
                    flag = 1;
                    dt.Rows[0]["code"] = "-107"; dt.Rows[0]["Message"] = "Invalid Member Code";
                }
            }
            catch (Exception ex)
            {
                flag = 1;
                dt.Rows[0]["code"] = "-500"; dt.Rows[0]["Message"] = ex.ToString();
            }
            if (flag == 0)
            {
                DataTable objdt      = objPCService.SavePCClaim(objPC);
                var       jsonString = "{ "
                                       + JsonConvert.SerializeObject("code", Formatting.Indented) + ":" + JsonConvert.SerializeObject("-200", Formatting.Indented)
                                       + "," + JsonConvert.SerializeObject("Message", Formatting.Indented) + ":" + JsonConvert.SerializeObject("Policy Valid", Formatting.Indented)
                                       + ","
                                       + JsonConvert.SerializeObject("Response", Formatting.Indented) + ":" + JsonConvert.SerializeObject(objdt, Formatting.Indented) + " }";
                return(jsonString);
            }
            else
            {
                var jsonString = "{ "
                                 + JsonConvert.SerializeObject("code", Formatting.Indented) + ":" + JsonConvert.SerializeObject("-200", Formatting.Indented)
                                 + "," + JsonConvert.SerializeObject("Message", Formatting.Indented) + ":" + JsonConvert.SerializeObject("Policy Valid", Formatting.Indented)
                                 + ","
                                 + JsonConvert.SerializeObject("Response", Formatting.Indented) + ":" + JsonConvert.SerializeObject(dt, Formatting.Indented) + " }";
                return(jsonString);
                //return JsonConvert.SerializeObject(dt);
            }
        }