예제 #1
0
        //工长加入装修案例
        public int AddWebBuiding(WebBuiding webBuiding)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                context.WebBuiding.Add(webBuiding);
                DecDemand dec = context.DecDemand.Find(webBuiding.DemandID);
                if (dec != null)
                {
                    dec.IsPlan = true;
                }
                context.SaveChanges();
                if (webBuiding.constructionstageID != null)
                {
                    WebBuiding    org       = GetWebBuidingByDemandID(webBuiding.DemandID);
                    List <string> listid    = webBuiding.constructionstageID.Split(',').Where(c => c != "").ToList();
                    List <string> listStage = webBuiding.constructionstage.Split(',').Where(c => c != "").ToList();
                    int           i         = 0;
                    foreach (string id in listid)
                    {
                        WebBuidingStages stage = new WebBuidingStages
                        {
                            WebBuidingID = org.BuidingID,
                            StageID      = Convert.ToInt32(id),
                            StageName    = listStage[i],
                            sortID       = i
                        };
                        context.WebBuidingStages.Add(stage);
                        i++;
                    }
                    context.SaveChanges();
                }

                return(1);
            }
        }
예제 #2
0
 public int UpdateWebUser(WebUser newWebUser)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         WebUser originalUser = context.WebUser.Find(newWebUser.UserID);
         if (originalUser != null)
         {
             originalUser.TrueName  = newWebUser.TrueName;
             originalUser.UserType  = newWebUser.UserType;
             originalUser.NickName  = newWebUser.NickName;
             originalUser.Telephone = newWebUser.Telephone;
             originalUser.Sex       = newWebUser.Sex;
             originalUser.Cellphone = newWebUser.Cellphone;
             originalUser.Email     = newWebUser.Email;
             originalUser.Address   = newWebUser.Address;
             originalUser.Fax       = newWebUser.Fax;
             originalUser.IsLock    = newWebUser.IsLock;
             originalUser.InIp      = newWebUser.InIp;
             originalUser.Position  = newWebUser.Position;
             originalUser.InTime    = newWebUser.InTime;
             originalUser.Score     = newWebUser.Score;
             originalUser.InUser    = newWebUser.InUser;
             if (newWebUser.PositionCode == "WebWorker" || newWebUser.PositionCode == "WebWorkerLeader")
             {
                 wokSer.PassCheckByWorker(newWebUser.UserID, newWebUser.InUser);
             }
             originalUser.IsActivity = newWebUser.IsActivity;
             originalUser.EditOn     = DateTime.Now;
             context.SaveChanges();
         }
         return(1);
     }
 }
예제 #3
0
        public int AddDecTender(DecTender DecTender)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                try
                {
                    DecTender tender = context.DecTender.FirstOrDefault(c => c.Guid == DecTender.Guid && c.UserID == DecTender.UserID && c.IsDelete == 0);
                    if (tender == null)
                    {
                        context.DecTender.Add(DecTender);
                        context.SaveChanges();
                        return(1);
                    }
                    else
                    {
                        return(2);
                    }
                }
                catch (Exception e)
                {
                }

                return(0);
            }
        }
예제 #4
0
 //选他装修
 public int SelectWorker(int id)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         DecTender     tender = new DecTender();
         DemandService denSer = new DemandService();
         tender = context.DecTender.Find(id);
         if (tender != null)
         {
             tender.IsAccept = 1;
             DecDemand demand = context.DecDemand.FirstOrDefault(c => c.Guid == tender.Guid);
             demand.IsAccept    = 0;
             demand.GetUserID   = tender.UserID;
             demand.GetUserType = "WebUser";
             demand.EditOn      = DateTime.Now;
             List <DecTender> list = context.DecTender.Where(c => c.Guid == tender.Guid && c.UserID != tender.UserID).ToList();
             if (list != null)
             {
                 foreach (var item in list)
                 {
                     item.IsAccept = 2;
                     item.EditOn   = DateTime.Now;
                 }
             }
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
예제 #5
0
 public int UpdateWebFile(WebFile webFile)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         WebFile originalFile = context.WebFile.Find(webFile.FileID);
         if (originalFile != null)
         {
             originalFile.ClassID     = webFile.ClassID;
             originalFile.ClassName   = webFile.ClassName;
             originalFile.Click       = webFile.Click;
             originalFile.CompanyId   = webFile.CompanyId;
             originalFile.Description = webFile.Description;
             originalFile.FileName    = webFile.FileName;
             originalFile.FileType    = webFile.FileType;
             originalFile.InTime      = webFile.InTime;
             originalFile.InUser      = webFile.InUser;
             originalFile.Remark      = webFile.Remark;
             originalFile.Sequence    = webFile.Sequence;
             originalFile.Tags        = webFile.Tags;
             originalFile.Title       = webFile.Title;
             originalFile.Editon      = DateTime.Now;
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
예제 #6
0
        //设计师后台修改
        public int UpdateWebCasefromCenter(WebCase webCase)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                WebCase originalCase = context.WebCase.Find(webCase.CaseID);
                if (originalCase != null)
                {
                    originalCase.CaseBrief      = webCase.CaseBrief;
                    originalCase.CaseImageBig   = webCase.CaseImageBig;
                    originalCase.thumbnailImage = webCase.thumbnailImage;
                    originalCase.CaseInfo       = webCase.CaseInfo;
                    originalCase.CaseTitle      = webCase.CaseTitle;
                    originalCase.CompanyID      = 0;
                    originalCase.IsTop          = webCase.IsTop;
                    originalCase.PeopleID       = webCase.PeopleID;

                    originalCase.ShowOrder   = 0;
                    originalCase.CostArea    = webCase.CostArea;
                    originalCase.Style       = webCase.Style;
                    originalCase.HouseType   = webCase.HouseType;
                    originalCase.HouseArea   = webCase.HouseArea;
                    originalCase.GzStyle     = webCase.GzStyle;
                    originalCase.Jobschedule = webCase.Jobschedule;
                    originalCase.EditOn      = DateTime.Now;
                    originalCase.DecType     = webCase.DecType;
                    context.SaveChanges();
                    return(1);
                }
                else
                {
                    return(0);
                }
            }
        }
예제 #7
0
        //添加案例同时添加缩略图
        public int AddWebCase(WebCase webCase)
        {
            WebCompanyService comSer = new WebCompanyService();
            WebPeopleService  peoSer = new WebPeopleService();

            using (AIYunNetContext context = new AIYunNetContext())
            {
                context.WebCase.Add(webCase);

                string[] list = ImageHelper.GetHvtImgUrls(webCase.CaseInfo);
                foreach (var item in list)
                {
                    string     thum = ImageHelper.GetthumImgByUrl(item);
                    WebCaseImg img  = new WebCaseImg
                    {
                        CompanyID      = webCase.CompanyID,
                        CompanyName    = webCase.CompanyID == 0?"":comSer.GetWebCompanyByID(webCase.CompanyID).CompanyName,
                        PeopleID       = webCase.PeopleID,
                        PeopleName     = webCase.PeopleID == 0?"":peoSer.GetWebPeopleByID(webCase.PeopleID).PeopleName,
                        imgName        = webCase.CaseTitle,
                        Img            = item,
                        thumbnailImage = thum,
                        WebCaseID      = webCase.CaseID,
                        DecType        = webCase.DecType,
                        GzStyle        = webCase.GzStyle,
                        JzStyle        = webCase.Style
                    };
                    context.WebCaseImg.Add(img);
                }
                context.SaveChanges();
                return(1);
            }
        }
        public int UpdateWebPeopleAuthentication(WebPeopleAuthentication WebPeopleAuthentication)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (WebPeopleAuthentication != null)
                {
                    WebPeopleAuthentication origWebPeopleAuthentication = context.WebPeopleAuthentication.FirstOrDefault(c => c.UserID == WebPeopleAuthentication.UserID);
                    if (origWebPeopleAuthentication != null)
                    {
                        origWebPeopleAuthentication.TrueName = WebPeopleAuthentication.TrueName;
                        //origWebPeopleAuthentication.UserID = WebPeopleAuthentication.UserID;
                        origWebPeopleAuthentication.UserIdentity     = WebPeopleAuthentication.UserTrueName;
                        origWebPeopleAuthentication.UserType         = WebPeopleAuthentication.UserType;
                        origWebPeopleAuthentication.IsAuthentication = 0;
                        origWebPeopleAuthentication.ShengfenF        = WebPeopleAuthentication.ShengfenF;
                        origWebPeopleAuthentication.ShengfenZ        = WebPeopleAuthentication.ShengfenZ;
                        origWebPeopleAuthentication.UserTrueName     = WebPeopleAuthentication.UserTrueName;
                        origWebPeopleAuthentication.EditOn           = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
예제 #9
0
 public int UpdateWebCompanyRegist(WebCompany webCompany)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         WebCompany originalCompany = context.WebCompany.Find(webCompany.CompanyID);
         if (originalCompany != null && webCompany != null)
         {
             originalCompany.CompanyType     = webCompany.CompanyType;
             originalCompany.RegistAddress   = webCompany.RegistAddress;
             originalCompany.RegistAuthority = webCompany.RegistAuthority;
             originalCompany.RegistMark      = webCompany.RegistMark;
             originalCompany.RepresentPerson = webCompany.RepresentPerson;
             originalCompany.CompanyAddOn    = webCompany.CompanyAddOn;
             originalCompany.BusinessScope   = webCompany.BusinessScope;
             originalCompany.RegistMoney     = webCompany.RegistMoney;
             originalCompany.EditOn          = DateTime.Now;
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
예제 #10
0
 public int UpdateWebMenu(WebMenu webMenu)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         if (webMenu != null)
         {
             WebMenu originalMenu = context.WebMenu.Find(webMenu.WebMenuID);
             if (originalMenu != null)
             {
                 originalMenu.EditOn      = DateTime.Now;
                 originalMenu.EnglishName = webMenu.EnglishName;
                 originalMenu.ImageUrl    = webMenu.ImageUrl;
                 originalMenu.IsDisplay   = webMenu.IsDisplay;
                 originalMenu.ParentID    = webMenu.ParentID;
                 originalMenu.ParentName  = webMenu.ParentName;
                 originalMenu.ShowOrder   = webMenu.ShowOrder;
                 originalMenu.ShowUrl     = webMenu.ShowUrl;
                 originalMenu.Style       = webMenu.Style;
                 originalMenu.WebMenuName = webMenu.WebMenuName;
                 context.SaveChanges();
                 return(1);
             }
             else
             {
                 return(0);
             }
         }
         else
         {
             return(0);
         }
     }
 }
예제 #11
0
 public int DeleteDownLoadtype(int id)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         DownLoadType originalDownLoad = context.DownLoadType.Find(id);
         if (originalDownLoad != null)
         {
             originalDownLoad.Isdelete = 1;
             List <DownLoadType> list = context.DownLoadType.Where(c => c.fatherID == id).ToList();
             if (list.Count() > 0)
             {
                 foreach (var item in list)
                 {
                     item.Isdelete = 1;
                 }
             }
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
예제 #12
0
 public int UpdateWebImg(WebImg WebImg)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         WebImg originalImg = context.WebImg.Find(WebImg.ImgId);
         if (originalImg != null)
         {
             originalImg.ImgTitle        = WebImg.ImgTitle;
             originalImg.ImgInfo         = WebImg.ImgInfo;
             originalImg.ImgContent      = WebImg.ImgContent;
             originalImg.thumbnailImage  = WebImg.thumbnailImage;
             originalImg.ImgUrl          = WebImg.ImgUrl;
             originalImg.softcoverstyle  = WebImg.softcoverstyle;
             originalImg.hotalstyle      = WebImg.hotalstyle;
             originalImg.designerrstyle  = WebImg.designerrstyle;
             originalImg.commercialstyle = WebImg.commercialstyle;
             originalImg.IsPublish       = WebImg.IsPublish;
             originalImg.IsTop           = WebImg.IsTop;
             originalImg.editon          = DateTime.Now;
             originalImg.ImgJzspce       = WebImg.ImgJzspce;
             originalImg.ImgGzspace      = WebImg.ImgGzspace;
             originalImg.ImgJzstyle      = WebImg.ImgJzstyle;
             originalImg.DecType         = WebImg.DecType;
             originalImg.CompanyID       = 0;
             originalImg.PeopleID        = 0;
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
        public int UpdateWebCompanyAuthentication(WebCompanyAuthentication WebCompanyAuthentication)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (WebCompanyAuthentication != null)
                {
                    WebCompanyAuthentication origWebCompanyAuthentication = context.WebCompanyAuthentication.FirstOrDefault(c => c.CompanyUserID == WebCompanyAuthentication.CompanyUserID);
                    if (origWebCompanyAuthentication != null)
                    {
                        origWebCompanyAuthentication.CompanyID        = WebCompanyAuthentication.CompanyID;
                        origWebCompanyAuthentication.CompanyName      = WebCompanyAuthentication.CompanyName;
                        origWebCompanyAuthentication.PeopleName       = WebCompanyAuthentication.PeopleName;
                        origWebCompanyAuthentication.IsAuthentication = 0;
                        origWebCompanyAuthentication.ShengfenF        = WebCompanyAuthentication.ShengfenF;
                        origWebCompanyAuthentication.ShengfenZ        = WebCompanyAuthentication.ShengfenZ;
                        origWebCompanyAuthentication.PeopleIdentity   = WebCompanyAuthentication.PeopleIdentity;
                        origWebCompanyAuthentication.ZthumbnailImage  = WebCompanyAuthentication.ZthumbnailImage;
                        origWebCompanyAuthentication.FthumbnailImage  = WebCompanyAuthentication.FthumbnailImage;
                        origWebCompanyAuthentication.UploadFile       = WebCompanyAuthentication.UploadFile;
                        origWebCompanyAuthentication.EditOn           = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
예제 #14
0
        public int UpdateWebGoods(WebGoods WebGoods)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (WebGoods != null)
                {
                    WebGoods origWebGoods = context.WebGoods.Find(WebGoods.GoodsID);
                    if (origWebGoods != null)
                    {
                        origWebGoods.goods_name     = WebGoods.goods_name;
                        origWebGoods.goods_desc     = WebGoods.goods_desc;
                        origWebGoods.logo           = WebGoods.logo;
                        origWebGoods.price          = WebGoods.price;
                        origWebGoods.is_on_sale     = WebGoods.is_on_sale;
                        origWebGoods.IsTop          = WebGoods.IsTop;
                        origWebGoods.thumbnailImage = WebGoods.thumbnailImage;
                        origWebGoods.Goodstock      = WebGoods.Goodstock;
                        origWebGoods.Belongs        = WebGoods.Belongs;
                        origWebGoods.Newprice       = WebGoods.Newprice;
                        origWebGoods.Salesnum       = WebGoods.Salesnum;
                        origWebGoods.goods_Info     = WebGoods.goods_Info;
                        origWebGoods.EditOn         = DateTime.Now;
                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
예제 #15
0
 public int UpdateDownLoad(DownLoad DownLoad)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         DownLoad originalDownLoad = context.DownLoad.Find(DownLoad.ID);
         if (originalDownLoad != null)
         {
             originalDownLoad.EditOn         = DateTime.Now;
             originalDownLoad.fileurl        = DownLoad.fileurl;
             originalDownLoad.firstID        = DownLoad.firstID;
             originalDownLoad.form           = DownLoad.form;
             originalDownLoad.DownLoadImage  = DownLoad.DownLoadImage;
             originalDownLoad.Info           = DownLoad.Info;
             originalDownLoad.LookupCode     = DownLoad.LookupCode;
             originalDownLoad.score          = DownLoad.score;
             originalDownLoad.secondID       = DownLoad.secondID;
             originalDownLoad.Size           = DownLoad.Size;
             originalDownLoad.thumbnailImage = DownLoad.thumbnailImage;
             originalDownLoad.title          = DownLoad.title;
             //originalDownLoad.upbody = DownLoad.upbody;
             //originalDownLoad.userid = DownLoad.userid;
             //originalDownLoad.usertype = DownLoad.usertype;
             context.SaveChanges();
             return(1);
         }
         else
         {
             return(0);
         }
     }
 }
예제 #16
0
        //从个人中心修改
        public int UpdateWebPeopleFromCenter(WebPeople webPeople)
        {
            using (AIYunNetContext context = new AIYunNetContext())
            {
                if (webPeople != null)
                {
                    WebPeople  originalPeople = context.WebPeople.Find(webPeople.PeopleID);
                    WebCompany company        = context.WebCompany.Find(webPeople.CompanyID);
                    if (originalPeople != null)
                    {
                        //originalPeople.Address = webPeople.Address;
                        //originalPeople.BelongArea = webPeople.BelongArea;
                        //originalPeople.CaseCount = webPeople.CaseCount;
                        if (webPeople.CompanyID == 0)
                        {
                            originalPeople.CompanyID   = 0;
                            originalPeople.CompanyName = "";
                        }
                        else
                        {
                            originalPeople.CompanyID   = webPeople.CompanyID;
                            originalPeople.CompanyName = company.CompanyName;
                        }
                        originalPeople.EditOn = DateTime.Now;
                        //originalPeople.GoodAtStyle = webPeople.GoodAtStyle;
                        //originalPeople.IsApproved = webPeople.IsApproved;
                        //originalPeople.IsAuthentication = webPeople.IsAuthentication;
                        //originalPeople.IsBond = webPeople.IsBond;
                        //originalPeople.IsBuildingCount = webPeople.IsBuildingCount;
                        //originalPeople.IsTop = webPeople.IsTop;
                        originalPeople.PeopleCategory = webPeople.PeopleCategory;
                        //originalPeople.PeopleInfo = webPeople.PeopleInfo;
                        //originalPeople.PeopleLevel = webPeople.PeopleLevel;
                        originalPeople.PeopleMail = webPeople.PeopleMail;
                        //originalPeople.PeopleMotto = webPeople.PeopleMotto;
                        originalPeople.PeopleName  = webPeople.PeopleName;
                        originalPeople.PeoplePhone = webPeople.PeoplePhone;
                        originalPeople.PeopleImage = webPeople.PeopleImage;
                        //originalPeople.DesignerImage = webPeople.DesignerImage == null ? "" : webPeople.DesignerImage;
                        originalPeople.thumbnailImage = webPeople.thumbnailImage == null ? "" : webPeople.thumbnailImage;
                        originalPeople.ProvinceID     = webPeople.ProvinceID;
                        originalPeople.ProvinceName   = webPeople.ProvinceName;
                        originalPeople.CityID         = webPeople.CityID;
                        originalPeople.CityName       = webPeople.CityName;
                        originalPeople.AreasID        = webPeople.AreasID;
                        originalPeople.AreasName      = webPeople.AreasName;
                        //originalPeople.ShowOrder = webPeople.ShowOrder;
                        //originalPeople.WorkYears = webPeople.WorkYears;
                        //originalPeople.PeoplePosition = webPeople.PeoplePosition;

                        context.SaveChanges();
                    }
                }


                return(1);
            }
        }
예제 #17
0
 public int addBuidingCase(WebBuidingCase buidingcase)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebBuidingCase.Add(buidingcase);
         context.SaveChanges();
         return(1);
     }
 }
예제 #18
0
 public int AddWebFriendLink(WebFriendLink webFriendLink)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebFriendLink.Add(webFriendLink);
         context.SaveChanges();
         return(1);
     }
 }
 public int AddWebCompanyGuarantMoney(WebCompanyGuarantMoney WebCompanyGuarantMoney)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebCompanyGuarantMoney.Add(WebCompanyGuarantMoney);
         context.SaveChanges();
         return(1);
     }
 }
예제 #20
0
 public int AddWebNews(WebNews webNews)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebNews.Add(webNews);
         context.SaveChanges();
         return(1);
     }
 }
예제 #21
0
 public int AddWebGoods(WebGoods WebGoods)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebGoods.Add(WebGoods);
         context.SaveChanges();
         return(1);
     }
 }
예제 #22
0
 public int AddWebImg(WebImg WebImg)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebImg.Add(WebImg);
         context.SaveChanges();
         return(1);
     }
 }
예제 #23
0
 public int AddWebPeople(WebPeople webPeople)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebPeople.Add(webPeople);
         context.SaveChanges();
         return(1);
     }
 }
예제 #24
0
 public int AddWebPicture(WebPicture WebPicture)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebPicture.Add(WebPicture);
         context.SaveChanges();
         return(1);
     }
 }
 public int AddContract(WebBuidingContract constract)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebBuidingContract.Add(constract);
         context.SaveChanges();
         return(1);
     }
 }
예제 #26
0
 public int addDownLoadtype(DownLoadType downloadtype)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.DownLoadType.Add(downloadtype);
         context.SaveChanges();
         return(1);
     }
 }
예제 #27
0
 public int AddPeopleJian(PeopleJian PeopleJian)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.PeopleJian.Add(PeopleJian);
         context.SaveChanges();
         return(1);
     }
 }
예제 #28
0
 public int AddDownLoad(DownLoad DownLoad)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.DownLoad.Add(DownLoad);
         context.SaveChanges();
         return(1);
     }
 }
예제 #29
0
 /// <summary>
 /// 添加
 /// </summary>
 public int AddWebWorker(WebWorker WebWorker)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebWorker.Add(WebWorker);
         context.SaveChanges();
         return(1);
     }
 }
예제 #30
0
 public int AddWebCompany(WebCompany webCompany)
 {
     using (AIYunNetContext context = new AIYunNetContext())
     {
         context.WebCompany.Add(webCompany);
         context.SaveChanges();
         return(1);
     }
 }