public async Task <string> NoteCreate([FromBody] string value) { string newNoteID = "0"; try { dynamic photoshootNote = JsonConvert.DeserializeObject <Object>(value); int ref_id = photoshootNote.ref_id; string note = photoshootNote.note; int created_by = photoshootNote.created_by; double created_at = _common.GetTimeStemp(); newNoteID = await _NotesAndDoc.GenericPostNote <string>(ref_id, note_type, note, created_by, created_at); int userId = photoshootNote.created_by; await _eventRepo.AddEventAsync(new EventModel(product_event_table_name) { EventName = photoshoot_note_created, EntityId = ref_id, RefrenceId = ref_id, UserId = userId }); await _eventRepo.AddEventAsync(new EventModel(user_event_table_name) { EventName = photoshoot_note_created, EntityId = userId, RefrenceId = ref_id, UserId = userId, EventNoteId = ref_id }); } catch (Exception ex) { var logger = _loggerFactory.CreateLogger("internal_error_log"); logger.LogInformation("Problem happened in making new Photoshoot Note with message" + ex.Message); } return(newNoteID); }
public async Task <string> NoteCreate([FromBody] string value) { string newNoteID = "0"; try { dynamic productNote = JsonConvert.DeserializeObject <Object>(value); int ref_id = productNote.ref_id; string note = productNote.note; int created_by = productNote.created_by; double created_at = _common.GetTimeStemp(); newNoteID = await _NotesAndDoc.GenericPostNote <string>(ref_id, note_type, note, created_by, created_at); int userId = productNote.created_by; event_product_note_create = event_product_note_create.Replace("%%userid%%", userId.ToString()); event_product_note_create = event_product_note_create.Replace("%%pid%%", ref_id.ToString()); await _eventRepo.AddPhotoshootAsync(ref_id, event_product_note_create_id, ref_id, event_product_note_create, userId, _common.GetTimeStemp(), table_name); await _eventRepo.AddEventAsync(event_product_note_create_id, userId, ref_id, event_product_note_create, _common.GetTimeStemp(), user_event_table_name); } catch (Exception ex) { var logger = _loggerFactory.CreateLogger("internal_error_log"); logger.LogInformation("Problem happened in making new Photoshoot Note with message" + ex.Message); } return(newNoteID); }
public async Task <string> NoteCreate([FromBody] string value) { string newNoteID = "0"; try { dynamic newItemNote = JsonConvert.DeserializeObject <Object>(value); int ref_id = newItemNote.ref_id; string note = newItemNote.note; int created_by = newItemNote.created_by; double created_at = _common.GetTimeStemp(); newNoteID = await _NotesAndDoc.GenericPostNote <string>(ref_id, note_type, note, created_by, created_at); var item_note_create = "item_note_create"; var eventModel = new EventModel(tableName) { EntityId = ref_id, EventName = item_note_create, RefrenceId = Int32.Parse(newNoteID), UserId = created_by, EventNoteId = Int32.Parse(newNoteID) }; await _eventRepo.AddEventAsync(eventModel); var userEvent = new EventModel(userEventTableName) { EntityId = created_by, EventName = item_note_create, RefrenceId = Int32.Parse(newNoteID), UserId = created_by, EventNoteId = Int32.Parse(newNoteID) }; await _eventRepo.AddEventAsync(userEvent); } catch (Exception ex) { var logger = _loggerFactory.CreateLogger("internal_error_log"); logger.LogInformation("Problem happened in making new Item Note with message" + ex.Message); } return(newNoteID); }