Пример #1
0
        public ActionMessage DeleteDocumentsByFeature(string feature, string ids)
        {
            ActionMessage ret = new ActionMessage();

            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                try
                {
                    string[] IDsarray = ids.Split(',');
                    foreach (string id in IDsarray)
                    {
                        FilesHelpers.DeleteFolder(feature, id);
                        DocumentDataLayer.GetInstance().DeleteDocumentByFeatureAndID(connection, feature, Int32.Parse(id));
                    }
                    ret.isSuccess = true;
                }
                catch (Exception ex)
                {
                    ret.isSuccess     = false;
                    ret.err.msgCode   = "Internal Error";
                    ret.err.msgString = ex.ToString();
                }
            }
            return(ret);
        }
Пример #2
0
        public ActionMessage DeleteDocumentByFeature(string feature, int id)
        {
            ActionMessage ret = new ActionMessage();

            SqlConnectionFactory sqlConnection = new SqlConnectionFactory();

            using (SqlConnection connection = sqlConnection.GetConnection())
            {
                try
                {
                    FilesHelpers.DeleteFolder(feature, id.ToString());
                    DocumentDataLayer.GetInstance().DeleteDocumentByFeatureAndID(connection, feature, id);
                    ret.isSuccess = true;
                }
                catch (Exception ex)
                {
                    ret.isSuccess     = false;
                    ret.err.msgCode   = "Internal Error";
                    ret.err.msgString = ex.ToString();
                }
            }
            return(ret);
        }