private void Save() { if (NoteControlValidation()) { Business.Sales.Notes Obj = new Business.Sales.Notes(); Entity.Sales.Notes Model = new Entity.Sales.Notes { Id = NoteId, ContactId = Convert.ToInt32(ddlContact.SelectedValue), CreatedBy = Convert.ToInt32(HttpContext.Current.User.Identity.Name), Description = txtDescription.Text, Name = txtName.Text, IsActive = true }; NoteId = Obj.SaveNotes(Model); if (NoteId > 0) { SaveNoteLinks(); ClearControls(); LoadNotesList(); NoteId = 0; Message.IsSuccess = true; Message.Text = "Saved Successfully"; } else { Message.IsSuccess = false; Message.Text = "Unable to save data."; } Message.Show = true; } }
public int SaveNoteLinks(Entity.Sales.Notes Model) { NotesDbModel DbModel = new NotesDbModel(); Model.CopyPropertiesTo(DbModel); return(NotesDataAccess.SaveNoteLinks(DbModel)); }
private void SaveNoteLinks() { Business.Sales.Notes Obj = new Business.Sales.Notes(); Entity.Sales.Notes Model = new Entity.Sales.Notes { Id = NoteId, LinkId = Convert.ToInt32(hdnItemId.Value), LinkType = (SalesLinkType)Enum.Parse(typeof(SalesLinkType), hdnItemType.Value) }; Obj.SaveNoteLinks(Model); }
private void GetNoteById() { Business.Sales.Notes Obj = new Business.Sales.Notes(); Entity.Sales.Notes notes = Obj.GetNoteById(NoteId); if (notes.Id != 0) { ddlContact.SelectedValue = notes.ContactId.ToString(); txtDescription.Text = notes.Description; txtName.Text = notes.Name.ToString(); } }
public Entity.Sales.Notes GetNoteById(int Id) { Entity.Sales.Notes note = new Entity.Sales.Notes(); NotesDataAccess.GetNoteById(Id).CopyPropertiesTo(note); return(note); }