Example #1
0
        public static string AddThemeAndSale(int themeID, int saleID, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {

                    if (saleID != 0)
                    {
                        tbl_theme_salespage tva = new tbl_theme_salespage();
                        tva.ThemeID = themeID;
                        tva.SalePageID = saleID;
                        db.AddTotbl_theme_salespage(tva);
                    }
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = KeyManager.RetrunSucceed;
                    }
                    else
                    {
                        returnStr = KeyManager.RetrunUnSucceed;
                        LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "新增主题与促销页面的关联关系,themeID=" + themeID + ",saleID=" + saleID, loginUserInfo);
                    }
                }
            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "新增主题与促销页面的关联关系,themeID=" + themeID + ",saleID=" + saleID + ";错误信息:" + e.Message, loginUserInfo);
            }

            return returnStr;
        }
Example #2
0
        public static string AddThemeSales(int themeID, string saleIDs, string loginUserInfo)
        {
            string returnStr = "";
            try
            {
                using (venuesEntities db = new venuesEntities())
                {
                    DeleteThemeSalesByThemeId(themeID, loginUserInfo);

                    List<string> mlist = new List<string>(saleIDs.Split(','));

                    foreach (String saleID in mlist)
                     {
                         if (saleID != "")
                         {
                             tbl_theme_salespage tva = new tbl_theme_salespage();
                             tva.ThemeID = themeID;
                             tva.SalePageID = int.Parse(saleID);
                             db.AddTotbl_theme_salespage(tva);
                         }
                     }
                    if (db.SaveChanges() != 0)
                    {
                        returnStr = KeyManager.RetrunSucceed;
                    }
                    else
                    {
                        returnStr = KeyManager.RetrunUnSucceed;
                        LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "新增主题与促销页面的关联关系,themeID=" + themeID + ",saleIDs=" + saleIDs, loginUserInfo);
                    }
                }

            }
            catch (Exception e)
            {
                LogManager.addLog(KeyManager.LogTypeId_Error, KeyManager.MENUS.Menu_SalesManager, "新增主题与促销页面的关联关系,themeID=" + themeID + ",saleIDs=" + saleIDs + ";错误信息:" + e.Message, loginUserInfo);
            }

            return returnStr;
        }