Пример #1
0
        public int Add_Request_Json_Detail(string message_id, string request_type, string json = "")
        {
            int Value = 0;
            fadv_touchlessEntities     entit = new fadv_touchlessEntities();
            tbl_request_details        tbl   = new tbl_request_details();
            List <tbl_request_details> lst   = new List <tbl_request_details>();

            try
            {
                tbl.messageid    = message_id;
                tbl.json_text    = json;
                tbl.request_type = request_type;

                lst.Add(tbl);
                entit.tbl_request_details.AddRange(lst);
                entit.SaveChanges();
                Value = 1;
            }
            catch (Exception ex)
            {
                Value = 0;
                throw ex;
            }
            return(Value);
        }
Пример #2
0
        public int Add_Response_Json(long request_id, List <tbl_yettostart_casecreation_data> lst, string json = "")
        {
            int Value = 0;

            try
            {
                if (lst.Count > 0)
                {
                    using (fadv_touchlessEntities entit = new fadv_touchlessEntities())
                    {
                        entit.tbl_yettostart_casecreation_data.AddRange(lst);
                        entit.SaveChanges();
                    }
                }
                tbl_response_detail        tbl         = new tbl_response_detail();
                List <tbl_response_detail> lstResponse = new List <tbl_response_detail>();
                tbl.request_id    = request_id; // Int64.Parse(request_id);
                tbl.response_json = json;
                tbl.status        = 1;

                lstResponse.Add(tbl);
                using (fadv_touchlessEntities entit = new fadv_touchlessEntities())
                {
                    entit.tbl_response_detail.AddRange(lstResponse);
                    entit.SaveChanges();

                    tbl_request_details processData = entit.tbl_request_details.Where(x => x.id == request_id).First();

                    processData.Status = 1;
                    entit.SaveChanges();
                }
                Value = 1;
            }
            catch (Exception ex)
            {
                Value = 0;
                throw ex;
            }
            return(Value);
        }
Пример #3
0
        public int Add_Response_Json(long request_id, string json = "", string message_id = "", string service_id = "")
        {
            int Value = 0;
            fadv_touchlessEntities     entit = new fadv_touchlessEntities();
            tbl_response_detail        tbl   = new tbl_response_detail();
            List <tbl_response_detail> lst   = new List <tbl_response_detail>();

            tbl_request_details        tblReq = new tbl_request_details();
            List <tbl_request_details> lstReq = new List <tbl_request_details>();

            try
            {
                tbl.request_id    = request_id; // Int64.Parse(request_id);
                tbl.response_json = json;
                tbl.message_id    = message_id;
                tbl.service_id    = service_id;
                tbl.status        = 1;

                lst.Add(tbl);
                entit.tbl_response_detail.AddRange(lst);
                entit.SaveChanges();
                // Update Request Status
                using (fadv_touchlessEntities entities = new fadv_touchlessEntities())
                {
                    tbl_request_details processData = entities.tbl_request_details.Where(x => x.id == request_id).First();

                    processData.Status = 1;
                    entities.SaveChanges();
                }
                Value = 1;
            }
            catch (Exception ex)
            {
                Value = 0;
                throw ex;
            }
            return(Value);
        }