Ejemplo n.º 1
0
        public string Final_Create_Case_Json(string MessageId, tbl_Wipro_Details CandidateDetails, string package, string Database_Sent, string PONumber, string fileupload, string clientID, string SBUID, string clientName, string Service_Id = "CaseCreation", string RequestID = "", string sbuName = "")
        {
            string header = getHeader("CSPi Touchless App", Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "query", "DownloadData", "Download Data from Customer Portal", Guid.NewGuid().ToString(), Guid.NewGuid().ToString(), "1.0.0", "1", "no", "jwt.token");
            string status = getStatus("", "", "");
            string data   = "\"Data\":{";

            data += "\"CaseCreation\":{";
            //data = data + Final_Create_Case_Json_DataTag(lstFreshCase, lstCollege);
            data = data + Final_Create_Case_Json_DataWipro(CandidateDetails, package, Database_Sent, PONumber, fileupload, clientID, SBUID, clientName, RequestID, sbuName);
            data = data + "}";

            string finalJson = "{";

            finalJson = finalJson + header + "," + data + "}," + status + "}";
            return(finalJson.Replace("’", ""));
        }
Ejemplo n.º 2
0
        public string Create_Case_Creation_Json(long reqId, long resId, tbl_Wipro_Details CandidateDetails, string package, string Database_Sent, string PONumber, string fileupload, string clientID, string SBUID, string clientName, string sbuName, string PackageName)
        {
            string           output = "";
            DML_Utility      objDML = new DML_Utility();
            Get_Data_Utility objGet = new Get_Data_Utility();

            try
            {
                string strRequest_Id   = "";
                string strCandidate_Id = "";
                string strAssociate_Id = "";
                // List<tbl_requests> RequestID = objGet.Get_RequestID();
                //objDML.Add_Exception_Log("Before", "");

                //decimal NewRequestID = RequestID[0].RequestID + 1;
                //objDML.Add_Exception_Log("After", "");

                // Get Data

                JsonCreater objFinal  = new JsonCreater();
                string      MessageId = Guid.NewGuid().ToString();
                string      ServiceId = "CaseCreation";// FilePath_Container.CaseCreation;
                //fileupload = "";
                string jsonFinal            = objFinal.Final_Create_Case_Json(MessageId, CandidateDetails, package, Database_Sent, PONumber, fileupload, clientID, SBUID, clientName, ServiceId, sbuName: sbuName);
                string jsonFinalForRequests = objFinal.Final_Create_Case_JsonForRequests(MessageId, CandidateDetails, package, Database_Sent, PONumber, fileupload, clientID, SBUID, clientName, ServiceId, sbuName: sbuName);
                objDML.Add_Exception_Log("Wipro log : " + jsonFinal, "Json_Data");
                string JsonDatRequests = Read_Json_DataForCaseCreation(jsonFinalForRequests, "Data", "CaseCreation", "clientSpecificFields");
                objDML.Add_Exception_Log("Wipro log : " + JsonDatRequests, "Json_Data");
                /////////////////////////// Add Json request into database //////////////
                //objDML.Add_Exception_Log(lstFreshCase.Count().ToString(), Convert.ToString(NewRequestID));
                string NewRequestID = "0";
                int    ADDRequests  = objDML.Insert_data_in_requests(ref NewRequestID, CandidateDetails, JsonDatRequests, clientID, SBUID);
                jsonFinal = objFinal.Final_Create_Case_Json(MessageId, CandidateDetails, package, Database_Sent, PONumber, fileupload, clientID, SBUID, clientName, ServiceId, RequestID: NewRequestID, sbuName: sbuName);
                objDML.Insert_Json_in_requestracker(Convert.ToString(NewRequestID), jsonFinal);
                objDML.Insert_Json_in_requesStateInstanse(Convert.ToInt64(NewRequestID), 1, "REQ-0002", 165, "Case Created by Touchless", 1, 5, 0);



                //Uploading The downloaded files
                string        destinationPath = ConfigurationManager.AppSettings["destinationPath"] + "\\" + NewRequestID;
                FileUtility   fileUtility     = new FileUtility();
                List <string> copiedFiles     = fileUtility.FileUpload(fileupload, destinationPath);
                objDML.Add_Exception_Log("Wipro log : " + copiedFiles.Count + "Files Uploaded", "");
                objDML.Insert_FilePathIndocument_upload(copiedFiles, Convert.ToInt64(NewRequestID));
                objDML.Add_Exception_Log("Wipro log : " + "Files Path Inserted in database", NewRequestID.ToString());


                objDML.Add_Exception_Log("Wipro log : " + "RequestInstance Created", NewRequestID.ToString());
                objDML.updateWiproDetails(CandidateDetails.Candidte_Id, CandidateDetails.Check_Initiated, Convert.ToInt64(NewRequestID));

                string packageID = objGet.getPackageID(PackageName, SBUID);
                objDML.InsertPackageDetails(Convert.ToInt64(NewRequestID), packageID);



                int            iDML   = objDML.Add_Request_Json_Detail(MessageId, "CaseCreation", jsonFinal);
                ExecuteProcess objExe = new ExecuteProcess();
                if (iDML == 1)
                {
                    bool ret = objExe.Write_JSON_TO_ServerRABBIT_MQ(jsonFinal);
                    output = ret ? "Success" : "Failed";
                    objDML.Add_Exception_Log("Wipro log : " + output, "");
                }

                //bool ret = objExe.Write_JSON_TO_RABBIT_MQ(jsonFinal);
                //output = ret ? "Success" : "Failed";
            }
            catch (Exception ex)
            {
                output = "ex";
                //throw ex;
                while (ex != null)
                {
                    int iException = objDML.Add_Exception_Log("Wipro exception : " + ex.Message, "Create_Case_Creation_Json");
                    ex = ex.InnerException;
                }
            }

            return(output);
        }
Ejemplo n.º 3
0
        public string Final_Create_Case_Json_DataForRequests(tbl_Wipro_Details CandidateDetails, string package, string Database_Sent, string PONumber, string fileupload, string clientid,
                                                             string SBUID, string ClientName, string RequestID, string sbuName)

        {
            ///////////////// Scraping Data Variables ////////////////////


            string LOA_Status = "";

            ///////////////// Yet2Start Data Variables ////////////////////


            ///////////////// MISLog Data Variables ////////////////////


            // Start Creating Json //
            string crnCreatedDate        = ""; //System.DateTime.Now.ToString();// "Need To Discuss"; // cuurent date
            string middleName            = ""; //"Need To Discuss";
            string sbuEntitiesId         = SBUID;
            string sbu                   = sbuName;
            string subjectDetails        = "FADV";
            string subjectType           = "Candidate";
            string typeOfCheck           = "SRT";
            string authorizationLetter   = "Yes";// LOA_Status;
            string packageType           = "Soft Copy";
            string srtData               = "SRT";
            string lOASubmited           = "Yes";// LOA_Status; //
            string bVFSubmitted          = "Yes";
            string isClientSpecificField = "true";
            //string request_field_id = "Need To Discuss";
            string miscrn           = "";
            string last_name        = "";
            string gender           = "";          //"Need To Discuss";
            string Position         = "";          //"Need To Discuss";
            string IdentityDocument = "";          //"Need To Discuss";

            string Unique_Identifier = "";         //"Need To Discuss";
            string comment           = "";         //"Need To Discuss";
            string request_status    = "";         //"Need To Discuss";
            string clientName        = ClientName; //"Need To Discuss";
            string File_Upload       = fileupload; //"Need To Discuss";
            string clientrefNo       = "";

            if (sbuName.Contains("Laterals - Pre employment"))
            {
                Database_Sent = "";
                clientrefNo   = CandidateDetails.Candidte_Id;
            }
            else if (sbuName.Contains("Laterals - Post Employment"))
            {
                clientrefNo = CandidateDetails.Employee_No;
            }
            else if (sbuName.Contains("Laterals - Pre Joining"))
            {
                clientrefNo = "";
            }
            DateTime dob          = Convert.ToDateTime(CandidateDetails.Date_Of_Birth, CultureInfo.InvariantCulture);   // DateTime.ParseExact(CandidateDetails.Date_Of_Birth, "MM/dd/yyyy",CultureInfo.InvariantCulture);
            DateTime doj          = Convert.ToDateTime(CandidateDetails.Date_Of_Joining, CultureInfo.InvariantCulture); // DateTime.ParseExact(CandidateDetails.Date_Of_Birth, "MM/dd/yyyy",CultureInfo.InvariantCulture);
            string   jsonDownload = "";

            jsonDownload = jsonDownload + "\"requestId\": \"" + RequestID + "\",";
            jsonDownload = jsonDownload + "\"clientId\": \"" + clientid + "\",";
            jsonDownload = jsonDownload + "\"crnNo\": \"" + miscrn + "\",";
            jsonDownload = jsonDownload + "\"crnCreatedDate\": \"" + crnCreatedDate + "\",";
            jsonDownload = jsonDownload + "\"firstName\": \"" + CandidateDetails.Employee_Name + "\",";
            jsonDownload = jsonDownload + "\"middleName\": \"" + middleName + "\",";
            jsonDownload = jsonDownload + "\"lastName\": \"" + last_name + "\",";
            jsonDownload = jsonDownload + "\"dateOfBirth\": \"" + dob.ToString("dd/MM/yyyy") + "\",";// Convert.ToDateTime(CandidateDetails.Date_Of_Birth).ToString("dd/MM/yyyy")
            jsonDownload = jsonDownload + "\"startDate\": \"" + doj.ToString("dd/MM/yyyy") + "\",";
            jsonDownload = jsonDownload + "\"sbuEntitiesId\": \"" + sbuEntitiesId + "\",";
            jsonDownload = jsonDownload + "\"clientReferenceNo\": \"" + ((CandidateDetails.Candidte_Id != "0") ? CandidateDetails.Candidte_Id : CandidateDetails.Employee_No) + "\",";//client_ref_no

            //jsonDownload = jsonDownload + "\"clientReferenceNo\": \"" + "278916" + "\",";//client_ref_no
            jsonDownload = jsonDownload + "\"subjectDetails\": \"" + subjectDetails + "\",";
            jsonDownload = jsonDownload + "\"subjectType\": \"" + subjectType + "\",";
            jsonDownload = jsonDownload + "\"typeOfCheck\": \"" + typeOfCheck + "\",";
            jsonDownload = jsonDownload + "\"authorizationLetter\": \"" + authorizationLetter + "\",";
            jsonDownload = jsonDownload + "\"packageType\": \"" + packageType + "\",";
            jsonDownload = jsonDownload + "\"srtData\": \"" + srtData + "\",";
            jsonDownload = jsonDownload + "\"lOASubmited\": \"" + lOASubmited + "\",";
            jsonDownload = jsonDownload + "\"bVFSubmitted\": \"" + bVFSubmitted + "\",";
            jsonDownload = jsonDownload + "\"isClientSpecificField\": \"" + isClientSpecificField + "\",";
            jsonDownload = jsonDownload + "\"clientSpecificFields\":{";

            jsonDownload = jsonDownload + clientSpecificFields("Fathers_Name", CandidateDetails.Fathers_Name, CandidateDetails.Fathers_Name, "43") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Candidate_Identification_Number", CandidateDetails.Candidte_Id, CandidateDetails.Candidte_Id, "81") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Po_Number", PONumber, PONumber, "83") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Database_Sent", Database_Sent, Database_Sent, "138") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Sow_Name", "", "", "216") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Location", CandidateDetails.Posting_Location, CandidateDetails.Posting_Location, "67") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Client_Code2", PONumber, PONumber, "139") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Gender", "", "", "119") + ",";
            jsonDownload = jsonDownload + clientSpecificFields("Actual_Date", "", "", "143");

            jsonDownload = jsonDownload + "},";
            jsonDownload = jsonDownload + "\"comment\": \"" + comment + "\",";
            jsonDownload = jsonDownload + "\"request_status\": \"" + request_status + "\",";
            jsonDownload = jsonDownload + "\"packageList\": [\"" + package + "\"],"; // Need to Discuss
            jsonDownload = jsonDownload + "\"clientName\": \"" + clientName + "\",";
            jsonDownload = jsonDownload + "\"sbuEntitiesName\": \"" + sbu + "\",";
            jsonDownload = jsonDownload + "\"packageName\": \"" + package + "\","; // Need to Discuss
            jsonDownload = jsonDownload + "\"File_Upload\": \"" + File_Upload + "\"";
            return(jsonDownload);
        }