public CustomerViewModel()
 {
     this.CustomerBag        = new Customer();
     this.PhoneBag           = new Phone();
     this.AddressBag         = new Address();
     this.Customers          = new List <Customer>();
     this.InsuranceBag       = new Insurance();
     this.InsuranceCompanies = new List <InsuranceCompany>();
     this.DocumentTypes      = new List <DocumentType>();
     this.DocumentTypeBag    = new DocumentType();
     this.PartialViewInfoBag = new PartialViewInfo()
     {
         ModelName = "", SubTitle = ""
     };
 }
Exemplo n.º 2
0
        public PartialViewInfo CampaignLeftNavigationDetails(int campaignId)
        {
            ACM.Model.Campaign response    = new ACM.Model.Campaign();
            PartialViewInfo    partialInfo = new PartialViewInfo();

            try
            {
                using (ACM_Redesign2014Context ctx = new ACM_Redesign2014Context())
                {
                    var listItems = (ctx.Database.SqlQuery <GetLeftNavDetails_Result>("GetLeftNavDetails  @CampaignId",
                                                                                      new SqlParameter("CampaignId", campaignId)

                                                                                      )).ToList();


                    foreach (var item in listItems)
                    {
                        partialInfo.CampaignId   = item.campaignId;
                        partialInfo.CampaignType = item.CampaignTypeName;
                        partialInfo.CampaignName = item.campaignname;
                        partialInfo.ATMPM        = item.primaryPMName;
                        partialInfo.SecondaryPM  = item.secondaryPMName;
                        partialInfo.PromoButton  = item.PromoButtonName;
                        partialInfo.Note         = item.Notes;
                        partialInfo.Status       = item.campaignstatus;
                    }

                    return(partialInfo);
                }
            }
            catch (Exception ex)
            {
                Error.WriteException(TraceEventType.Error, ex.Message.ToString(), "CampaignLeftNavigationDetails");
                throw;
            }
        }