public int Check_Rule_Engine_CVT_UT(long request_id, long response_id, List <Yet2Start_College> lst) { int Value = 0; try { Get_Data_Utility objGet = new Get_Data_Utility(); foreach (var obj in lst) { int cvt = 0; int ut = 0; string college = obj.college.Trim(); string degree = obj.degree.Trim(); sbyte active = 1; List <tbl_college_details> lstResponse = new List <tbl_college_details>(); lstResponse = objGet.Get_College_Details(request_id, response_id, college, degree); foreach (var cd in lstResponse) { long cdid = cd.id; string fieldsource = cd.field_source.Trim(); if (cd.field_source.ToLower() == "cvt") { cvt = 1; } else if (cd.field_source.ToLower() == "ut") { ut = 1; } if (cvt > 0 & ut > 0) { using (fadv_touchlessEntities entit = new fadv_touchlessEntities()) { List <tbl_college_details> processData = entit.tbl_college_details.Where(x => x.field_source == "UT" && x.reqid == request_id && x.resid == response_id && x.college == college && x.degree == degree).ToList <tbl_college_details>(); foreach (var uddt in processData) { tbl_college_details updatedata = entit.tbl_college_details.Where(x => x.id == uddt.id).First(); updatedata.active = 9; 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; }