//koushik code public int Insert_FilePathIndocument_upload(List<string> Files, long requestID) { int Value = 0; fadv_touchlessEntities entit = new fadv_touchlessEntities(); tbl_document_upload tbl = new tbl_document_upload(); List<tbl_document_upload> lst = new List<tbl_document_upload>(); DML_Utility objDML = new DML_Utility(); try { foreach (var file in Files) { tbl = new tbl_document_upload(); tbl.Document_Path = file; tbl.Date_Created = DateTime.Now; tbl.Date_Modified = DateTime.Now; tbl.PartitionKey = 0; tbl.Requestid = requestID; lst.Add(tbl); } entit.tbl_document_upload.AddRange(lst); entit.SaveChanges(); Value = 1; } catch (Exception ex) { objDML.Add_Exception_Log(ex.Message, "Insert_FilePathIndocument_upload"); Value = 0; throw ex; } return Value; }
public string getPackageID(string package, string SBUID) { DML_Utility objDML = new DML_Utility(); try { fadv_touchlessEntities entity = new fadv_touchlessEntities(); DataTable retVal = new DataTable(); string sql = "select PackageID from tbl_packages where Package_name='" + package + "' and SBUID=" + SBUID + ";"; retVal = entity.Database.SqlQuery <DataTable>(sql).FirstOrDefault(); var sequenceQueryResult = entity.Database.SqlQuery <string>(sql).ToList(); return(sequenceQueryResult[0]); } catch (Exception ex) { objDML.Add_Exception_Log("Wipro exception : " + "Package is not found in CSPI Express for" + package + "And" + SBUID, ex.Message); throw; } }
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; }