当前位置: 首页>>代码示例>>C#>>正文


C# venuesEntities.DeleteObject方法代码示例

本文整理汇总了C#中WebService.venuesEntities.DeleteObject方法的典型用法代码示例。如果您正苦于以下问题:C# venuesEntities.DeleteObject方法的具体用法?C# venuesEntities.DeleteObject怎么用?C# venuesEntities.DeleteObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebService.venuesEntities的用法示例。


在下文中一共展示了venuesEntities.DeleteObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteLogsByIDs

        /// <summary>
        /// 根据日志id列表删除日志记录
        /// </summary>
        /// <param name="curUserID"></param>
        /// <param name="logIds"></param>
        /// <returns></returns>
        public static string DeleteLogsByIDs(int curUserID, String logIds, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    List<string> logslist = new List<string>(logIds.Split(','));

                    foreach (String clogId in logslist)
                    {
                        if (clogId != "")
                        {
                            int curlogID = int.Parse(clogId);
                            tbl_sys_log su = db.tbl_sys_log.First<tbl_sys_log>(a => a.Log_Id.Equals(curlogID));

                            db.DeleteObject(su);
                        }
                    }
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_LogsManager, "删除日志成功,logIds=" + logIds, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_LogsManager, "删除日志失败,logIds=" + logIds + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:40,代码来源:LogManager.cs

示例2: DeleteResourceByIDs

        public static string DeleteResourceByIDs(String fileIds, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    List<string> filelist = new List<string>(fileIds.Split(','));

                    foreach (String cId in filelist)
                    {
                        if (cId != "")
                        {
                            int curID = int.Parse(cId);
                            tbl_file bus = db.tbl_file.First<tbl_file>(a => a.ID.Equals(curID));

                            db.DeleteObject(bus);
                        }
                    }
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "根据资源id删除资源记录成功,fileIds=" + fileIds, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "根据资源id删除资源记录,fileIds=" + fileIds + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:34,代码来源:ResourceManager.cs

示例3: DeletePageModuleAttributeByPageAndModuleID

        public static String DeletePageModuleAttributeByPageAndModuleID(int mId, string loginUserInfo,int pageID)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    ObjectQuery<tbl_page_module_attribute> tva = db.tbl_page_module_attribute.Where("[email protected] AND [email protected]", new ObjectParameter("v", mId), new ObjectParameter("u", pageID));

                    ObjectResult<tbl_page_module_attribute> results = tva.Execute(MergeOption.NoTracking);

                    foreach (tbl_page_module_attribute item in results)
                    {
                        db.AttachTo("tbl_page_module_attribute", item);
                        db.DeleteObject(item);
                    };
                    if (db.SaveChanges() != 0)
                        returnStr = KeyManager.RetrunSucceed;
                    else
                        returnStr = KeyManager.RetrunUnSucceed;
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "根据moduleId和pageID删除页面模块其他属性,moduleId=" + mId + ",pageID="+pageID+";错误信息:" + e.Message, loginUserInfo);
            }
            LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_PagesManager, "根据moduleId和pageID删除页面模块其他属性,moduleId=" + mId + ",pageID=" + pageID, loginUserInfo);
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:29,代码来源:PageModuleAttributeManager.cs

示例4: DeleteResourceByVenueID

        public static string DeleteResourceByVenueID(int veneuID, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    if (veneuID != 0)
                    {
                        ObjectQuery<tbl_file> tva = db.tbl_file.Where("[email protected]", new ObjectParameter("v", veneuID));

                        ObjectResult<tbl_file> results = tva.Execute(MergeOption.NoTracking);

                        foreach (tbl_file item in results)
                        {
                            db.AttachTo("tbl_file", item);
                            db.DeleteObject(item);
                        };
                        if (db.SaveChanges() != 0)
                        {
                            returnStr = KeyManager.RetrunSucceed;
                            LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除资源记录成功,veneuID=" + veneuID, loginUserInfo);
                        }
                        else
                            returnStr = KeyManager.RetrunUnSucceed;
                    }
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "根据场所id删除资源记录,veneuID=" + veneuID + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:34,代码来源:ResourceManager.cs

示例5: DeleteGuestMessageByIDs

        public static string DeleteGuestMessageByIDs(String guestMessageIds, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    List<string> glist = new List<string>(guestMessageIds.Split(','));

                    foreach (String cId in glist)
                    {
                        if (cId != "")
                        {
                            int curID = int.Parse(cId);
                            tbl_guest_message bus = db.tbl_guest_message.First<tbl_guest_message>(a => a.ID.Equals(curID));

                            db.DeleteObject(bus);
                        }
                    }
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VisitorManager, "根据游客留言id删除游客留言记录,guestMessageIds=" + guestMessageIds, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VisitorManager, "根据游客留言id删除游客留言记录,guestMessageIds=" + guestMessageIds + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:34,代码来源:GuestManager.cs

示例6: DeletePageContentByPageID

        public static string DeletePageContentByPageID(int pageID,string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    ObjectQuery<tbl_page_content> tva = db.tbl_page_content.Where("[email protected]", new ObjectParameter("v", pageID));

                    ObjectResult<tbl_page_content> results = tva.Execute(MergeOption.NoTracking);

                    foreach (tbl_page_content item in results)
                    {
                        db.AttachTo("tbl_page_content", item);
                        db.DeleteObject(item);
                    };
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_PagesManager, "删除页面内容成功,pageID=" + pageID, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_PagesManager, "删除页面内容,pageID=" + pageID + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:31,代码来源:PageContentManager.cs

示例7: DeleteMeetingRoomByIDs

        public static string DeleteMeetingRoomByIDs(String meetingIds, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    List<string> list = new List<string>(meetingIds.Split(','));

                    foreach (String cId in list)
                    {
                        if (cId != "")
                        {
                            int curMeetingID = int.Parse(cId);
                            tbl_venue_meetingroom bus = db.tbl_venue_meetingroom.First<tbl_venue_meetingroom>(a => a.ID.Equals(curMeetingID));
                            db.DeleteObject(bus);
                        }
                    }
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "删除会议室成功,meetingIds=" + meetingIds, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "删除会议室,meetingIds=" + meetingIds + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:33,代码来源:MeetingRoomManager.cs

示例8: DeleteUser

        /// <summary>
        /// 删除指定用户
        /// </summary>
        /// <param name="UserId">用户ID</param>
        /// <returns></returns>
        public static String DeleteUser(int curUserId, int deleteUserId, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    tbl_sys_user su = db.tbl_sys_user.First<tbl_sys_user>(a => a.User_Id.Equals(deleteUserId));

                    db.DeleteObject(su);

                    AuthorityManager.deleteAllAuthoriyByUserID(deleteUserId, KeyManager.UserTypeId_SystemUser, loginUserInfo);

                    if (db.SaveChanges() != 0)
                        returnStr = "成功!";
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SystemUsersManager, "删除用户,deleteUserId=" + deleteUserId + ";错误信息:" + e.Message, loginUserInfo);
            }
            LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_SystemUsersManager, "删除用户,deleteUserId=" + deleteUserId, loginUserInfo);
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:31,代码来源:UserManager.cs

示例9: DeleteSalesPageByID

        public static string DeleteSalesPageByID(int saleId,string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    tbl_sales bus = db.tbl_sales.First<tbl_sales>(a => a.ID.Equals(saleId));
                    int pageId = int.Parse(bus.SalesPageID.ToString());
                    db.DeleteObject(bus);

                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        PageManager.DeletePageByID(pageId, loginUserInfo);//同时删除page表中的促销页信息
                        ThemeSalesManager.DeleteThemeSalesBySaleId(saleId, loginUserInfo);//同时删除主题与该促销页的关联关系
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_SalesManager, "根据促销id删除促销页面记录,saleId=" + saleId, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "根据促销id删除促销页面记录,saleId=" + saleId + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:28,代码来源:SalesPageManager.cs

示例10: DeleteThemeByID

        public static string DeleteThemeByID(int themeId, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    if (themeId == 1)
                    {
                        returnStr = "此项为默认值,不可删除!";
                    }
                    else
                    {
                        tbl_theme bus = db.tbl_theme.First<tbl_theme>(a => a.ID.Equals(themeId));

                        db.DeleteObject(bus);
                        //删除主题关联的促销关联关系
                        ThemeSalesManager.DeleteThemeSalesByThemeId(themeId, loginUserInfo);

                        if (db.SaveChanges() != 0)
                        {
                            returnStr = "成功!";
                            LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_SalesManager, "根据促销主题id删除促销主题,themeId=" + themeId, loginUserInfo);
                        }
                        else
                            returnStr = "不成功!";
                    }
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "根据促销主题id删除促销主题,themeId=" + themeId + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:35,代码来源:ThemeManager.cs

示例11: DeleteADs

        public static String DeleteADs( string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {

                    //string strSql = string.Format("SELECT tad.ADImage,tad.ADName,tad.ID FROM tbl_ad AS tad");
                    //ObjectQuery<DbDataRecord> results = db.CreateQuery<DbDataRecord>(strSql);

                    //foreach (DbDataRecord item in results)
                    //{
                    //    db.DeleteObject(item);
                    //};
                    //if (db.SaveChanges() != 0)
                    //    returnStr = "成功!";
                    //else

                    ObjectQuery<tbl_ad> query = db.tbl_ad;
                    foreach (tbl_ad item in query)
                    {
                        db.DeleteObject(item);
                    }
                    db.SaveChanges();
                    returnStr = "成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_HandBookSetManager, "删除广告信息,错误信息:" + e.Message, loginUserInfo);
            }
            LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_HandBookSetManager, "删除广告信息", loginUserInfo);
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:35,代码来源:ADManager.cs

示例12: DeleteNewByID

        public static string DeleteNewByID(int newId,string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    tbl_news bus = db.tbl_news.First<tbl_news>(a => a.ID.Equals(newId));
                    int pageId = int.Parse(bus.NewsPage.ToString());
                    db.DeleteObject(bus);

                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        PageManager.DeletePageByID(pageId, loginUserInfo);
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_NewsManager, "删除新闻页面成功,newId=" + newId, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_NewsManager, "删除新闻页面,newId=" + newId + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:27,代码来源:NewsManager.cs

示例13: DeleteVenuesByIDs

        /// <summary>
        /// 根据场所id列表删除场所记录
        /// </summary>
        /// <param name="curUserID"></param>
        /// <param name="venuesIds"></param>
        /// <returns></returns>
        public static string DeleteVenuesByIDs(int curUserID, String venuesIds, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    List<string> venuelist = new List<string>(venuesIds.Split(','));

                    foreach (String cVenueId in venuelist)
                    {
                        if (cVenueId != "")
                        {
                            int curlogID = int.Parse(cVenueId);
                            tbl_sys_businessman bus = db.tbl_sys_businessman.First<tbl_sys_businessman>(a => a.Business_Id.Equals(cVenueId));

                            db.DeleteObject(bus);
                        }
                    }
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_VenusManager, "删除场所成功,venuesIds=" + venuesIds, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_VenusManager, "删除场所成功,venuesIds=" + venuesIds + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:40,代码来源:BusinessmanManager.cs

示例14: DeleteVenuTemplateByVenueID

        public static string DeleteVenuTemplateByVenueID(int venueID, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                 using (venuesEntities db = new venuesEntities())
                 {
                    //string strSql = string.Format("SELECT tt.ID,tt.TemplateID,tt.VenueID FROM tbl_venue_template AS tt WHERE tt.VenueID={0}", venueID);

                    //ObjectQuery<DbDataRecord> results = db.CreateQuery<DbDataRecord>(strSql);
                    //foreach (var item in results)
                    //{
                    //    //int deleteID = int.Parse(item["ID"].ToString());
                    //    //tbl_venue_template tvt = db.tbl_venue_template.First<tbl_venue_template>(a => a.ID.Equals(deleteID));
                    //    //db.DeleteObject(tvt);

                    //    int deleteID = int.Parse(item["ID"].ToString());
                    //    tbl_venue_template su = db.tbl_venue_template.First<tbl_venue_template>(a => a.ID.Equals(deleteID));
                    //    db.DeleteObject(su);

                    //    //db.AttachTo("tbl_venue_template", item);
                    //   // db.DeleteObject(item);
                    //}
                     ObjectQuery<tbl_venue_template> query = db.tbl_venue_template.Where("it.VenueID = @id", new ObjectParameter("id", venueID));
                     foreach (tbl_venue_template item in query)
                     {
                         db.DeleteObject(item);
                     }

                    if (db.SaveChanges() != 0)
                    {
                        returnStr = "成功!";
                        LogManager.addLog(KeyManager.LogTypeId_Option, KeyManager.MENUS.Menu_LogsManager, "根据场所id,删除场所模板关联表中的关联信息,venueID=" + venueID, loginUserInfo);
                    }
                    else
                        returnStr = "不成功!";
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_ModulesManager, "根据场所id,删除场所模板关联表中的关联信息,venueID=" + venueID + ";错误信息:" + e.Message, loginUserInfo);
            }
            return returnStr;
        }
开发者ID:zyyecho,项目名称:venues,代码行数:44,代码来源:VenueTemplateManager.cs

示例15: deleteAuthoriyByID

 /// <summary>
 /// 根据权限id,删除权限表
 /// </summary>
 public static void deleteAuthoriyByID(int authID, string loginUserInfo)
 {
     using (venuesEntities db = new venuesEntities())
     {
         try
         {
             string returnStr = "";
             tbl_sys_authority su = db.tbl_sys_authority.First<tbl_sys_authority>(a => a.AT_Id.Equals(authID));
             db.DeleteObject(su);
             if (db.SaveChanges() != 0)
                 returnStr = "成功!";
             else
                 returnStr = "不成功!";
         }
         catch (Exception e)
         {
             LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_Authority, "删除用户权限菜单,ID=" + authID + ",错误信息:" + e.Message, loginUserInfo);
         }
     }
 }
开发者ID:zyyecho,项目名称:venues,代码行数:23,代码来源:AuthorityManager.cs


注:本文中的WebService.venuesEntities.DeleteObject方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。