示例#1
0
        public ActionResult AddUpdateContact(ContactDetails objcont)
        {
            var Titlelist = context.SPgettitle().Select(xx => new SelectListItem {
                Value = xx.ToString(), Text = xx.ToString()
            }).ToList();

            ViewData["Titlelist"] = Titlelist;
            if (Request.QueryString["CompanyId"] != null)
            {
                int CompidIddecrypt = Convert.ToInt32(CryptorEngine.Decrypt(cm.Code_Decrypt(Convert.ToString(Request.QueryString["CompanyId"]))));
                objcont.companyid = CompidIddecrypt;
            }

            if (Request.QueryString["contactid"] != null)
            {
                int ConIddecrypt = Convert.ToInt32(CryptorEngine.Decrypt(cm.Code_Decrypt(Convert.ToString(Request.QueryString["contactid"]))));
                objcont.contactid = ConIddecrypt;
                // objcont.contactid = Convert.ToInt32(Request.QueryString["contactid"]);
            }
            if (Request.QueryString["compname"] != null)
            {
                ViewBag.compname = Convert.ToString(Request.QueryString["compname"]);
            }
            if (objcont.contactid != 0)
            {
                var contdata = context.SpGetContactDataforeditClient(objcont.contactid, User.Identity.Name, objcont.companyid).FirstOrDefault();
                if (contdata != null)
                {
                    // objcont.contactid = contdata.contactid;
                    objcont.contactfullname    = contdata.contactfullname;
                    objcont.contactemail       = contdata.contactemail;
                    objcont.contactcellphone   = contdata.contactcellphone;
                    objcont.contactphone       = contdata.contactphone;
                    objcont.titlestandard      = contdata.titlestandard;
                    objcont.linkedinprofileurl = contdata.linkedinprofileurl;
                    objcont.combinednotes      = contdata.contactnotes;
                    objcont.companyid          = contdata.companyid;
                }
            }

            return(View(objcont));
        }