Ejemplo n.º 1
0
        public IHttpActionResult serviceRequests(dynamic data)
        {
            dynamic objdata         = new ExpandoObject();
            string  serialized_data = token_gen.Authorize_aesdecrpty(data);

            try
            {
                serviceRequestModel rootobj = JsonConvert.DeserializeObject <serviceRequestModel>(serialized_data);
                return(Ok(cfmsHelper.serviceRequests(rootobj)));
            }
            catch (Exception ex)
            {
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(Ok(objdata));
        }
Ejemplo n.º 2
0
        public static dynamic generateChallan(serviceRequestModel obj)
        {
            dynamic objdata = new ExpandoObject();

            try
            {
                obj.type = "2";
                DataTable dt = cfmsChallanProc(obj);
                if (dt != null && dt.Rows.Count > 0)
                {
                    var data = Send_CFMS_Payment_Response(dt);

                    RootCfMSResponse objresponse = JsonConvert.DeserializeObject <RootCfMSResponse>(data);

                    if (string.IsNullOrEmpty(objresponse.Response.Message))
                    {
                        obj.type = "5";
                        obj.transaction_status = objresponse.Response.Transaction_Status;
                        obj.challanId          = objresponse.Response.CFMS_ID.ToString();
                        obj.ifsc_code          = objresponse.Response.IFSC_Code;
                        obj.valid_upto         = objresponse.Response.Valid_Upto.ToString();
                        obj.deptTxnId          = objresponse.Response.DeptTransID.ToString();
                        DataTable dtcfms = cfmsChallanProc(obj);
                        if (dtcfms != null && dtcfms.Rows.Count > 0 && dtcfms.Rows[0][0].ToString() == "1")
                        {
                            objdata.status    = true;
                            objdata.result    = objresponse.Response.Message;
                            objdata.Returnurl = "https://devcfms.apcfss.in:44300/sap/bc/ui5_ui5/sap/zfi_rcp_cstatus/index.html?sap-client=150&DeptID=" + objresponse.Response.DeptTransID.ToString();
                        }
                        else
                        {
                            DataTable dtcfms1 = cfmsChallanProc(obj);
                            if (dtcfms1 != null && dtcfms1.Rows.Count > 0 && dtcfms1.Rows[0][0].ToString() == "1")
                            {
                                objdata.status    = true;
                                objdata.result    = objresponse.Response.Message;
                                objdata.Returnurl = "https://devcfms.apcfss.in:44300/sap/bc/ui5_ui5/sap/zfi_rcp_cstatus/index.html?sap-client=150&DeptID=" + objresponse.Response.DeptTransID.ToString();
                            }
                        }
                    }
                    else
                    {
                        objdata.status = false;
                        objdata.result = objresponse.Response.Message;
                    }
                    //objdata.status = true;
                    // objdata.result = dt;
                }
                else
                {
                    objdata.status = false;
                    objdata.result = "Service Requests Not Available to load !!!";
                }
            }
            catch (Exception ex)
            {
                string mappath2   = HttpContext.Current.Server.MapPath("GenerateChallanExceptionLog");
                Task   WriteTask2 = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath2, "error from generate challan:" + JsonConvert.SerializeObject(obj) + ":" + ex.Message.ToString()));
                objdata.status = false;
                objdata.result = ex.Message.ToString();
            }
            return(objdata);
        }