コード例 #1
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            int  fileId = Convert.ToInt32(context.Request["fileid"]);
            bool result = fileApp.DeleteFile(fileId);

            if (result)
            {
                context.Response.Write("Remove Success!");
            }
            else
            {
                context.Response.Write("Remove Fail!");
            }
        }
コード例 #2
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            try
            {
                if (IdentityContext.UserID <= 0)
                {
                    return;
                }

                int tid = Convert.ToInt32(context.Request["tid"]);

                bool Result = ticketAPP.UpdateStatus(tid, Entity.TicketModel.TicketsState.Cancelled);

                if (Result)
                {
                    FileDeleteError = fileApp.DeleteFile(tid, FileSourceType.Ticket);
                    if (!FileDeleteError)
                    {
                        WebLogAgent.Write(string.Format("Error :DoCancelTicketHandler.ashx Messages:\r\n TicketID{0} File Delete Error ", tid));
                    }
                }

                if (Result)
                {
                    context.Response.Write("Remove Success!");
                }
                else
                {
                    context.Response.Write("Remove Fail!");
                }
            }
            catch (Exception ex)
            {
                context.Response.Write("para error!");
                WebLogAgent.Write(string.Format("Error Ashx:DoCancelTicketHandler.ashx Messages:\r\n{0}", ex));
                return;
            }
        }
コード例 #3
0
        public void ProcessRequest(HttpContext context)
        {
            if (IdentityContext.UserID <= 0)
            {
                return;
            }

            UsersEntity user = new App.UserApplication().GetUser(IdentityContext.UserID);

            if (user == null || (user.Role != RolesEnum.PM && user.Role != RolesEnum.Sales && user.Role != RolesEnum.ADMIN))
            {
                return;
            }

            ProposalTrackerApplication app = new ProposalTrackerApplication();

            context.Response.ContentType = "text/plain";
            string fId  = context.Request["fileId"] + "";
            string wrId = context.Request["wrId"] + "";

            int fileId;

            if (!int.TryParse(fId, out fileId))
            {
                return;
            }
            int proposaltrackerId;

            if (!int.TryParse(wrId, out proposaltrackerId))
            {
                return;
            }

            FileApplication fileApp = new FileApplication();

            fileApp.DeleteFile(fileId);
        }
コード例 #4
0
        public void ProcessRequest(HttpContext context)
        {
            if (IdentityContext.UserID <= 0)
            {
                return;
            }

            UsersEntity user = new App.UserApplication().GetUser(IdentityContext.UserID);

            if (user == null || (user.Role != RolesEnum.ADMIN && user.Role != RolesEnum.PM && user.Role != RolesEnum.Sales))
            {
                return;
            }

            string id = context.Request["ID"];
            int    fileId;

            if (!int.TryParse(id, out fileId))
            {
                return;
            }

            app.DeleteFile(fileId);
        }