示例#1
0
        public int Insert_data_in_requests(string RequestID, List <tbl_yettostart_casecreation_data> list)
        {
            int Value = 0;
            fadv_touchlessEntities entit = new fadv_touchlessEntities();
            tbl_requests           tbl   = new tbl_requests();
            List <tbl_requests>    lst   = new List <tbl_requests>();
            sbyte Dateofbirth            = 0;
            int   intRequestID           = Convert.ToInt32(RequestID);

            try
            {
                foreach (tbl_yettostart_casecreation_data item in list)
                {
                    if (item.first_name != string.Empty)
                    {
                        Dateofbirth = 1;
                    }
                    tbl.RequestID = Convert.ToUInt32(intRequestID);
                    // 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   = "";
                    tbl.Subject_Type     = "";
                    tbl.Is_Date_of_Birth = Dateofbirth;
                    tbl.Date_Of_Birth    = Convert.ToDateTime(item.date_of_birth);
                    tbl.Type_Of_Check    = "";               //Pre employment or Post employment or Both
                    tbl.Candidate_Authorization_Letter = ""; // Yes or No

                    tbl.Package_Type  = "";                  // 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     = "";

                    lst.Add(tbl);

                    Value = 1;
                    intRequestID++;
                }

                entit.tbl_requests.AddRange(lst);
                entit.SaveChanges();
            }
            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;
        }