示例#1
0
        public WrapperBuildingSupplier CreateSingleBuildingSupplier(BuildingSupplierENT UserProfile)
        {
            WrapperBuildingSupplier data = new WrapperBuildingSupplier();

            data.BuildingSupplier = new BuildingSupplierCRUD().CreateSingle(UserProfile);
            return(data);
        }
示例#2
0
        public BuildingSupplierENT SelectSingle(int Id)
        {
            NbkDbEntities            dbcontext = new NbkDbEntities();
            BuildingSupplierTemplate Obj       = dbcontext.BuildingSupplierTemplate.Where(x => x.Id == Id).FirstOrDefault();
            BuildingSupplierENT      Data      = new BuildingSupplierENT()
            {
                Id    = Obj.Id,
                Title = Obj.Title
            };

            return(Data);
        }
示例#3
0
        public BuildingSupplierENT CreateSingle(BuildingSupplierENT Obj)
        {
            NbkDbEntities            dbcontext = new NbkDbEntities();
            BuildingSupplierTemplate Data      = new BuildingSupplierTemplate()
            {
                Title = Obj.Title
            };


            dbcontext.BuildingSupplierTemplate.Add(Data);
            dbcontext.SaveChanges();

            Obj.Id = Data.Id;

            return(Obj);
        }
示例#4
0
        public BuildingSupplierENT UpdateSelectSingle(BuildingSupplierENT Obj)
        {
            NbkDbEntities            dbcontext = new NbkDbEntities();
            BuildingSupplierTemplate Data      = new BuildingSupplierTemplate()
            {
                Id    = Obj.Id,
                Title = Obj.Title
            };


            dbcontext.BuildingSupplierTemplate.Attach(Data);
            var update = dbcontext.Entry(Data);

            update.Property(x => x.Title).IsModified = true;

            dbcontext.SaveChanges();

            return(Obj);
        }
示例#5
0
        public string EmailSubjectReplacements(EmailTemplateENT template, ProjectENT projectDetail, ContactENT customer, ContactENT contactPerson, BuildingSupplierENT buildingSupplier, Users user)
        {
            string content = "";

            template.Title = template.Title.Replace("#CustomerName#", customer.Name);
            template.Title = template.Title.Replace("#Description#", projectDetail.Description);
            template.Title = template.Title.Replace("#Name#", user.FullName);
            template.Title = template.Title.Replace("#PhoneNumber#", user.ContactNo);
            template.Title = template.Title.Replace("#Email#", user.Email);
            template.Title = template.Title.Replace("#Designation#", user.Designation);
            if (contactPerson != null)
            {
                template.Title = template.Title.Replace("#ansvarlig#", contactPerson.Name);
            }
            else
            {
                template.Title = template.Title.Replace("#ansvarlig#", "");
            }
            template.Title = template.Title.Replace("#Address#", projectDetail.Address);
            template.Title = template.Title.Replace("#ProjectTitle#", projectDetail.Title);
            template.Title = template.Title.Replace("#CustomerPhone#", customer.ContactNo);
            template.Title = template.Title.Replace("#BuildingSupplier#", buildingSupplier.Title);
            content        = template.Title;

            return(content);
        }