當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。