/// <summary>
        /// 批量删除数据
        /// </summary>
        private void OnDelete()
        {
            string itemsAppend = hV.Value.Trim();

            if (string.IsNullOrEmpty(itemsAppend))
            {
                MessageBox.Messager(this.Page, this.Page.Controls[0], MessageContent.Submit_InvalidRow, "错误提醒", "error");
                return;
            }

            ContentDetail bll = new ContentDetail();

            string[]      itemsAppendArr = itemsAppend.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
            List <string> list           = itemsAppendArr.ToList <string>();

            if (bll.DeleteBatch(list))
            {
                MessageBox.MessagerShow(this.Page, this.Page.Controls[0], MessageContent.Submit_Success);
                Bind();
            }
            else
            {
                MessageBox.Messager(this.Page, this.Page.Controls[0], MessageContent.Submit_Error, "系统提示");
            }
        }
Esempio n. 2
0
        public ResResultModel DeleteContentDetail(string itemAppend)
        {
            try
            {
                if (string.IsNullOrWhiteSpace(itemAppend))
                {
                    return(ResResult.Response(false, MC.Request_Params_InvalidError, ""));
                }
                var items = itemAppend.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                var bll = new ContentDetail();

                if (bll.DeleteBatch((IList <object>)items.ToList <object>()))
                {
                    foreach (var item in items)
                    {
                        DeleteContentFile(item);
                    }
                }

                return(ResResult.Response(true, MC.M_Save_Ok, ""));
            }
            catch (Exception ex)
            {
                return(ResResult.Response(false, ex.Message, ""));
            }
        }
Esempio n. 3
0
        public string DelContentDetail(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);

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

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

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