Пример #1
0
 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);
 }
Пример #2
0
        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"));
        }
Пример #3
0
 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;
 }