public string Create_Case_Creation_Json(long reqId, long resId, string fileupload, string clientID, string SBUID, string clientName)
        {
            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
                ExecuteProcess         objExe = new ExecuteProcess();
                fadv_touchlessEntities entit  = new fadv_touchlessEntities();
                //tbl_yettostart_casecreation_data tbl = new tbl_yettostart_casecreation_data();
                List <tbl_yettostart_casecreation_data> lstFreshCase = entit.tbl_yettostart_casecreation_data.Where(x => x.responseId == resId && x.queue_request_id == reqId).ToList <tbl_yettostart_casecreation_data>();
                List <tbl_college_details> lstCollege = entit.tbl_college_details.Where(x => x.active == 1 && x.resid == resId && x.reqid == reqId).ToList <tbl_college_details>();
                foreach (var obj in lstFreshCase)
                {
                    strRequest_Id   = obj.request_id;
                    strAssociate_Id = obj.associate_id;
                    strCandidate_Id = obj.candidate_id;
                }
                //Code Commented as we need only till download documents
                List <tbl_input_request_data> lstYet2StartData = entit.tbl_input_request_data.Where(x => x.Request_ID == strRequest_Id && x.Associate_Id == strAssociate_Id && x.Candidate_ID == strCandidate_Id).ToList <tbl_input_request_data>();
                List <tbl_initiation_tracker> lstMISLog        = entit.tbl_initiation_tracker.Where(x => x.request_id == strRequest_Id && x.associate_id == strAssociate_Id && x.candidate_id == strCandidate_Id).ToList <tbl_initiation_tracker>();

                JsonCreater objFinal  = new JsonCreater();
                string      MessageId = Guid.NewGuid().ToString();
                string      ServiceId = FilePath_Container.CaseCreation;
                string      jsonFinal = objFinal.Final_Create_Case_Json(MessageId, lstFreshCase, lstCollege, lstYet2StartData, lstMISLog, fileupload, clientID, SBUID, clientName, ServiceId);
                objDML.Add_Exception_Log(jsonFinal, "Json_Data");
                string JsonDatRequests = Read_Json_DataForCaseCreation(jsonFinal, "Data", "CaseCreation", "clientSpecificFields");
                objDML.Add_Exception_Log(JsonDatRequests, "Json_Data");
                /////////////////////////// Add Json request into database //////////////
                //objDML.Add_Exception_Log(lstFreshCase.Count().ToString(), Convert.ToString(NewRequestID));
                //int ADDRequests = objDML.Insert_data_in_requests(Convert.ToString(NewRequestID), lstFreshCase, JsonDatRequests, clientID, SBUID);
                jsonFinal = objFinal.Final_Create_Case_Json(MessageId, lstFreshCase, lstCollege, lstYet2StartData, lstMISLog, fileupload, clientID, SBUID, clientName, ServiceId, Convert.ToString(NewRequestID));
                objDML.Insert_Json_in_requestracker(Convert.ToString(NewRequestID), jsonFinal);
                int iDML = objDML.Add_Request_Json_Detail(MessageId, "CaseCreation", jsonFinal);
                if (iDML == 1)
                {
                    bool ret = objExe.Write_JSON_TO_ServerRABBIT_MQ(jsonFinal);
                    output = ret ? "Success" : "Failed";
                    objDML.Add_Exception_Log(output, "");
                }

                //bool ret = objExe.Write_JSON_TO_RABBIT_MQ(jsonFinal);
                //output = ret ? "Success" : "Failed";
            }
            catch (Exception ex)
            {
                output = "ex";
                //throw ex;
                int iException = objDML.Add_Exception_Log(ex.Message, "");
            }

            return(output);
        }
Example #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);
        }