public long Get_FreshCase_Response_Id(string strRequestId)
        {
            List <tbl_yettostart_casecreation_data> lstObj = new List <tbl_yettostart_casecreation_data>();
            tbl_yettostart_casecreation_data        tbl    = new tbl_yettostart_casecreation_data();
            string Query = "select * from tbl_yettostart_casecreation_data where queue_request_id='" + strRequestId + "'";
            fadv_touchlessEntities entity = new fadv_touchlessEntities();

            try
            {
                lstObj = entity.tbl_yettostart_casecreation_data.SqlQuery(Query).ToList <tbl_yettostart_casecreation_data>();
                return(lstObj.Count > 0 ? string.IsNullOrEmpty(lstObj[0].id.ToString()) ? 0 : long.Parse(lstObj[0].id.ToString()) : 0);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public int updateYetTostart(long resId, long ExpresReqID)
        {
            int Value = 0;
            try
            {
                fadv_touchlessEntities entit = new fadv_touchlessEntities();
                tbl_yettostart_casecreation_data processData = entit.tbl_yettostart_casecreation_data.Where(x => x.queue_request_id == resId).First();
                processData.ExpressRequestID = ExpresReqID;
                entit.SaveChanges();

                Value = 1;
            }
            catch (Exception ex)
            {
                Value = 0;
                throw ex;
            }
            return Value;
        }
        public int Insert_data_in_requests(ref string RequestID, List<tbl_yettostart_casecreation_data> list, string JsonDatRequests, string clientID, string SBUID)
        {
            int Value = 0;
            fadv_touchlessEntities entit = new fadv_touchlessEntities();
            Get_Data_Utility objGet = new Get_Data_Utility();

            tbl_requests tbl = new tbl_requests();
            //List<tbl_requests> lst = new List<tbl_requests>();
            sbyte Dateofbirth = 0;
            DML_Utility objDML = new DML_Utility();
            List<tbl_requests> ListRequestID = objGet.Get_RequestID();
            //objDML.Add_Exception_Log("Before", "");

            decimal NewRequestID = ListRequestID[0].RequestID + 1;
            RequestID = NewRequestID.ToString();
            int intRequestID = Convert.ToInt32(RequestID);
            try
            {
                //foreach (tbl_yettostart_casecreation_data item in list)
                if (list.Count > 0)
                {
                    tbl_yettostart_casecreation_data item = list[0];
                    if (item.first_name != string.Empty) Dateofbirth = 1;
                    tbl.RequestID = Convert.ToUInt32(intRequestID);
                    tbl.ClientID = Convert.ToInt32(clientID);
                    // tbl.ClientID = 0;
                    tbl.First_Name = item.first_name;
                    tbl.Last_Name = item.last_name;
                    tbl.Middle_Name = "";
                    tbl.Client_Ref_No = item.client_ref_no;
                    tbl.Case_Date = DateTime.Now;
                    tbl.Subject_Detail = "FADV";
                    tbl.Subject_Type = "Candidate";
                    tbl.Is_Date_of_Birth = Dateofbirth;
                    tbl.Date_Of_Birth = Convert.ToDateTime(item.date_of_birth);
                    tbl.Type_Of_Check = "Both";//Pre employment or Post employment or Both
                    tbl.Candidate_Authorization_Letter = "Yes";// Yes or No

                    tbl.Package_Type = "Soft Copy"; // Soft Copy or Hard copy
                    tbl.Srt_Data = "SRT";
                    tbl.Date_Created = DateTime.Now;
                    tbl.Date_Modified = DateTime.Now;
                    tbl.Is_Active = true;
                    //  tbl.SBUID =0;
                    tbl.LOA_Submitted = "Yes";
                    tbl.BVF_Submitted = "Yes";
                    tbl.PartitionKey = 0;
                    tbl.JSON_Data = JsonDatRequests;
                    tbl.SBUID = Convert.ToInt64(SBUID);
                    //lst.Add(tbl);

                    Value = 1;
                    //intRequestID++;
                    entit.tbl_requests.Add(tbl);
                    entit.SaveChanges();
                }

               

            }
            catch (Exception ex)
            {
                objDML.Add_Exception_Log(ex.Message, "Insert_data_in_requests");
                objDML.Add_Exception_Log(ex.InnerException.Message, "Insert_data_in_requests");
                Value = 0;
                throw ex;
            }
            return Value;
        }