示例#1
0
        public string DelAnnouncement(string itemsAppend)
        {
            string errorMsg = string.Empty;

            try
            {
                itemsAppend = itemsAppend.Trim();
                if (string.IsNullOrEmpty(itemsAppend))
                {
                    return(MessageContent.Submit_InvalidRow);
                }

                string[] items = itemsAppend.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                Announcement bll = new Announcement();
                bll.DeleteBatch(items.ToList <object>());
            }
            catch (Exception ex)
            {
                errorMsg = ex.Message;
            }
            if (!string.IsNullOrEmpty(errorMsg))
            {
                return(MessageContent.AlertTitle_Ex_Error + ":" + errorMsg);
            }
            return("1");
        }
示例#2
0
        public string DelAnnouncement(string itemsAppend)
        {
            string errorMsg = string.Empty;

            try
            {
                if (!HttpContext.Current.User.IsInRole("Administrators"))
                {
                    return(MC.Role_InvalidError);
                }

                itemsAppend = itemsAppend.Trim();
                if (string.IsNullOrEmpty(itemsAppend))
                {
                    return(MC.Submit_InvalidRow);
                }

                string[] items = itemsAppend.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                Announcement bll = new Announcement();
                bll.DeleteBatch(items.ToList <object>());

                return("1");
            }
            catch (Exception ex)
            {
                errorMsg = ex.Message;
            }

            return(MC.GetString(MC.Submit_Ex_Error, errorMsg));
        }