Example #1
0
        public ActionResult SaveCompany(CompanyModel objcomp)
        {
            try
            {
                if (Request.QueryString["compid"] != null)
                {
                    objcomp.listid = Convert.ToInt32(Request.QueryString["compid"]);
                }
                if (Request.QueryString["companyidedit"] != null)
                {
                    objcomp.companyid = Convert.ToInt32(Request.QueryString["companyidedit"]);
                    var data = context.SPgetCompdetailsbycompid(objcomp.companyid).FirstOrDefault();
                    if (data != null)
                    {
                        objcomp.name    = data.name;
                        objcomp.biztype = data.biztype;
                        objcomp.addr2   = data.addr2;
                        objcomp.addr1   = data.addr1;
                        objcomp.weburl  = data.weburl;
                        objcomp.city    = data.city;
                        objcomp.state   = data.state;
                        objcomp.zip     = data.zip;
                        if (data.target == null)
                        {
                            objcomp.target = false;
                        }
                        else
                        {
                            objcomp.target = Convert.ToBoolean(data.target);
                        }
                        if (data.priority == null)
                        {
                            objcomp.priority = false;
                        }
                        else
                        {
                            objcomp.priority = Convert.ToBoolean(data.priority);
                        }

                        objcomp.phone      = data.phone;
                        objcomp.citycircle = data.citycircle;
                        objcomp.listid     = data.listid;
                    }
                }
                var listname = context.Prospecting_Lists.Where(x => x.listid == objcomp.listid).FirstOrDefault().listname;
                objcomp.listname = listname;
                ViewData["city"] = context.Companies.Where(X => X.listid == objcomp.listid).Select(xx => new SelectListItem {
                    Value = xx.citycircle, Text = xx.citycircle
                }).Distinct();
            }
            catch (Exception ex)
            {
                cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectViewList" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "SaveCompany", "NA", "NA", "NA", "WEB");
            }
            return(View(objcomp));
        }
Example #2
0
        public ActionResult Index(string Compid)
        {
            if (string.IsNullOrEmpty(Compid))
            {
                return(RedirectToAction("Index", "ProspectListsClient"));
            }
            CompContact objcomp = new CompContact();

            try
            {
                int CompidIddecrypt = Convert.ToInt32(CryptorEngine.Decrypt(cm.Code_Decrypt(Convert.ToString(Compid))));
                var data            = context.SPgetCompdetailsbycompid(CompidIddecrypt).FirstOrDefault();
                if (data != null)
                {
                    objcomp.name    = data.name;
                    objcomp.biztype = data.biztype;
                    objcomp.addr2   = data.addr2;
                    objcomp.addr1   = data.addr1;
                    objcomp.weburl  = data.weburl;
                    if (data.weburl != "" && data.weburl != null)
                    {
                        if (!data.weburl.Contains("http://") || !data.weburl.Contains("https://"))
                        {
                            objcomp.weburl = "http://" + data.weburl;
                        }
                    }
                    objcomp.city  = data.city;
                    objcomp.state = data.state;
                    objcomp.zip   = data.zip;
                    if (data.target == null)
                    {
                        objcomp.target = false;
                    }
                    else
                    {
                        objcomp.target = Convert.ToBoolean(data.target);
                    }
                    if (data.priority == null)
                    {
                        objcomp.priority = false;
                    }
                    else
                    {
                        objcomp.priority = Convert.ToBoolean(data.priority);
                    }

                    objcomp.phone      = data.phone;
                    objcomp.citycircle = data.citycircle;
                    objcomp.listid     = data.listid;
                    objcomp.companyid  = CompidIddecrypt;
                    var CompContacts = context.SpGetContactlistbyCompid(CompidIddecrypt, objcomp.listid).ToList();
                    if (CompContacts != null)
                    {
                        foreach (var i in CompContacts)
                        {
                            ContactDetails objcondetails = new ContactDetails();
                            objcondetails.contactid          = i.contactid;
                            objcondetails.companyid          = i.companyid;
                            objcondetails.contactfullname    = i.contactfullname;
                            objcondetails.titlestandard      = i.titlestandard;
                            objcondetails.contactphone       = i.contactphone;
                            objcondetails.contactcellphone   = i.contactcellphone;
                            objcondetails.contactemail       = i.contactemail;
                            objcondetails.listid             = i.listid;
                            objcondetails.linkedinprofileurl = i.linkedinprofileurl;
                            objcondetails.combinednotes      = i.combinednotes;
                            objcondetails.contactemail       = i.contactemail;
                        }
                    }
                }

                var Complst = context.SPgetCompanies(objcomp.listid).ToList().Select(xx => new SelectListItem {
                    Value = xx.companyid.ToString(), Text = xx.name + " - Business Type : " + xx.biztype
                }).ToList();
                ViewData["Complst"] = Complst;
                if (TempData["ConEmail"] != null)
                {
                    ViewBag.ConEmail = TempData["ConEmail"];
                }
            }
            catch (Exception ex)
            {
                cm.ErrorExceptionLogingByService(ex.ToString(), "ProspectViewCompanyClient" + ":" + new StackTrace().GetFrame(0).GetMethod().Name, "Index", "NA", "NA", "NA", "WEB");
            }
            return(View(objcomp));
        }