public bool UpdateOpportunity(Guid id, ProxyOpportunity opp) { //var xrm = new XrmServiceContext("Xrm"); Xrm.Opportunity orig = this.xrm.OpportunitySet.Where(c => c.Id == id).FirstOrDefault(); orig.Description = opp.Description; xrm.Update(orig); return(true); }
public ActionResult ResetPassword(string id) { if (null == id) { return(HttpNotFound()); } try { Contact contact = (Contact) context.Retrieve("contact", new Guid(id), new Microsoft.Xrm.Sdk.Query.ColumnSet(true)); contact.expl_Haslo = (string)Session[id]; contact.expl_salt = (string)Session[id + "_salt"]; contact.expl_passwordhash = (string)Session[id + "_hash"]; context.Update(contact); context.SaveChanges(); Session[id] = null; Session[id + "_salt"] = null; Session[id + "_hash"] = null; Session.RemoveAll(); } catch (Exception e) { Session[id] = null; Session[id + "_salt"] = null; Session[id + "_hash"] = null; Session.RemoveAll(); TempData["loginError"] = "Wystąpił błąd. Skontaktuj się z Administracją."; return(RedirectToAction("Index", "Login")); } Session[id] = null; Session[id + "_salt"] = null; Session[id + "_hash"] = null; Session.RemoveAll(); TempData["info"] = "Hasło zostało zmienione."; return(RedirectToAction("Index", "Login")); }
public bool UpdateOpportunity(Guid id, CustomOpportunity opp) { var xrm = new XrmServiceContext("Xrm"); Xrm.Opportunity orig = xrm.OpportunitySet.Where(c => c.Id == id).FirstOrDefault(); orig.Description = opp.Description; xrm.Update(orig); return true; }