Exemplo n.º 1
0
        public PartialViewResult EditNotes(HomeViewModels vm, string Command)
        {
            NoteManager mgr = new NoteManager();

            if (Command == "Edit")
            {
                mgr.EditNotes(vm);
                vm.SuccessMessage = true;
            }
            if (Command == "Delete")
            {
                mgr.DeleteNotes(vm.notes.note_id);
                vm.SuccessMessage = true;
            }

            return(PartialView("_EditNotes", vm));
        }
Exemplo n.º 2
0
        public ActionResult DeleteNotes(string Notes_ID, string RelatedTable, string RelateToID)
        {
            objResponse Response = new objResponse();

            session = new SessionHelper();
            try
            {
                Response = objNoteManager.DeleteNotes(Convert.ToInt64(Notes_ID), Convert.ToInt64(RelateToID), RelatedTable, Convert.ToInt64(session.UserSession.UserId), Convert.ToInt64(session.UserSession.PIN));


                if (Response.ErrorCode == 0)
                {
                    if (RelatedTable == "LEAD")
                    {
                        LeadsModel objLeadModel = new LeadsModel();
                        objLeadModel.Notes = objNoteManager.getNotesByRelateToID(Convert.ToInt64(session.UserSession.PIN), Convert.ToInt64(RelateToID), session.UserSession.UserId, "LEAD");
                        return(View("AjaxLeadNotes", objLeadModel));
                    }
                    else if (RelatedTable == "OPPORTUNITY")
                    {
                        OpportunityModel objOppoModel = new OpportunityModel();
                        objOppoModel.Notes = objNoteManager.getNotesByRelateToID(Convert.ToInt64(session.UserSession.PIN), Convert.ToInt64(RelateToID), session.UserSession.UserId, RelatedTable);
                        return(View("AjaxOppoNotes", objOppoModel));
                    }
                    else
                    {
                        ClientModel objClientModel = new ClientModel();
                        objClientModel.Notes = objNoteManager.getNotesByRelateToID(Convert.ToInt64(session.UserSession.PIN), Convert.ToInt64(RelateToID), session.UserSession.UserId, RelatedTable);
                        return(View("AjaxClientNote", objClientModel));
                    }
                }
                else
                {
                    return(Json("", JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception ex)
            {
                BAL.Common.LogManager.LogError("AjaxAddTask conto Method", 1, Convert.ToString(ex.Source), Convert.ToString(ex.Message), Convert.ToString(ex.StackTrace));
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }
Exemplo n.º 3
0
        public void DeleteNotes(int id)
        {
            NoteManager mgr = new NoteManager();

            mgr.DeleteNotes(id);
        }