Exemple #1
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     context.Response.Buffer = true;
     context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
     context.Response.AddHeader("pragma", "no-cache");
     context.Response.AddHeader("cache-control", "");
     context.Response.CacheControl = "no-cache";
     string Action = context.Request["action"];                      //提交动作
     string pkVal = context.Request["pkVal"];                        //字段值
     RM_System_IDAO sys_idao = new RM_System_Dal();
     int Return = -1;
     switch (Action)
     {
         case "restore_Data"://还原回收站数据
             Return = sys_idao.Recyclebin_Restore(pkVal.Split(','));
             context.Response.Write(Return.ToString());
             break;
         case "restore_Empty"://清空回收站数据
             Return = sys_idao.Recyclebin_Empty(pkVal.Split(','));
             context.Response.Write(Return.ToString());
             break;
         default:
             break;
     }
 }
Exemple #2
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     context.Response.Buffer = true;
     context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
     context.Response.AddHeader("pragma", "no-cache");
     context.Response.AddHeader("cache-control", "");
     context.Response.CacheControl = "no-cache";
     string Action = context.Request["action"].Trim();               //提交动作
     string ParentId = context.Request["ParentId"];
     string key = context.Request["key"];//主键
     RM_System_IDAO systemidao = new RM_System_Dal();
     switch (Action)
     {
         case "addButton"://菜单添加按钮
             context.Response.Write(systemidao.AllotButton(key, ParentId));
             context.Response.End();
             break;
         default:
             break;
     }
 }
 /// <summary>
 /// 公共一般处理程序
 /// </summary>
 /// <param name="context"></param>
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     context.Response.Buffer = true;
     context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
     context.Response.AddHeader("pragma", "no-cache");
     context.Response.AddHeader("cache-control", "");
     context.Response.CacheControl = "no-cache";
     string Action = context.Request["action"];              //提交动作
     string module = context.Request["module"];              //业务模块
     string tableName = context.Request["tableName"];        //数据库表
     string pkName = context.Request["pkName"];              //字段主键
     string pkVal = context.Request["pkVal"];                //字段值
     int Return = -1;
     RM_System_IDAO systemidao = new RM_System_Dal();
     switch (Action)
     {
         case "Cut":                     //安全退出
             context.Session.Abandon();  //取消当前会话
             context.Session.Clear();    //清除当前浏览器所以Session
             context.Response.Write(1);
             context.Response.End();
             break;
         case "Virtualdelete":           //数据放入回收站 1,2,3,4,5,6
             Return = systemidao.Virtualdelete(module.Trim(), tableName.Trim(), pkName.Trim(), pkVal.Trim().Split(','));
             context.Response.Write(Return.ToString());
             break;
         case "Delete":                  //删除多条记录 1,2,3,4,5,6
             Return = systemidao.DeleteData_Base(tableName.Trim(), pkName.Trim(), pkVal.Split(','));
             context.Response.Write(Return.ToString());
             break;
         case "IsExist":                 //判断数据是否存在
             Return = DataFactory.SqlDataBase().IsExist(tableName.Trim(), pkName.Trim(), pkVal.Trim());
             context.Response.Write(Return.ToString());
             break;
         default:
             break;
     }
 }
Exemple #4
0
 public void ProcessRequest(HttpContext context)
 {
     context.Response.ContentType = "text/plain";
     context.Response.Buffer = true;
     context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-1);
     context.Response.AddHeader("pragma", "no-cache");
     context.Response.AddHeader("cache-control", "");
     context.Response.CacheControl = "no-cache";
     string Action = context.Request["action"];                      //提交动作
     string user_Account = context.Request["user_Account"];          //账户
     string userPwd = context.Request["userPwd"];                    //密码
     string code = context.Request["code"];                          //验证码
     RM_UserInfo_IDAO user_idao = new RM_UserInfo_Dal();
     RM_System_IDAO sys_idao = new RM_System_Dal();
     IPScanerHelper objScan = new IPScanerHelper();
     switch (Action)
     {
         case "login":
             if (code.ToLower() != context.Session["dt_session_code"].ToString().ToLower())
             {
                 context.Response.Write("1");//验证码输入不正确!
                 context.Response.End();
             }
             DataTable dtlogin = user_idao.UserLogin(user_Account.Trim(), userPwd.Trim());
             if (dtlogin != null)
             {
                 objScan.DataPath = context.Server.MapPath("/Themes/IPScaner/QQWry.Dat");
                 objScan.IP = RequestHelper.GetIP();
                 string OWNER_address = objScan.IPLocation();
                 if (dtlogin.Rows.Count != 0)
                 {
                     user_idao.SysLoginLog(user_Account, "1", OWNER_address);
                     if (dtlogin.Rows[0]["DeleteMark"].ToString() == "1")
                     {
                         if (Islogin(context, user_Account))
                         {
                             SessionUser user = new SessionUser();
                             user.UserId = dtlogin.Rows[0]["User_ID"].ToString();
                             user.UserAccount = dtlogin.Rows[0]["User_Account"].ToString();
                             user.UserName = dtlogin.Rows[0]["User_Name"].ToString() + "(" + dtlogin.Rows[0]["User_Account"].ToString() + ")";
                             user.UserPwd = dtlogin.Rows[0]["User_Pwd"].ToString();
                             RequestSession.AddSessionUser(user);
                             context.Response.Write("3");//验证成功
                             context.Response.End();
                         }
                         else
                         {
                             context.Response.Write("6");//该用户已经登录,不允许重复登录
                             context.Response.End();
                         }
                     }
                     else
                     {
                         user_idao.SysLoginLog(user_Account, "2", OWNER_address);//账户被锁,联系管理员!
                         context.Response.Write("2");
                         context.Response.End();
                     }
                 }
                 else
                 {
                     user_idao.SysLoginLog(user_Account, "0", OWNER_address);
                     context.Response.Write("4");//账户或者密码有错误!
                     context.Response.End();
                 }
             }
             else
             {
                 context.Response.Write("5");//服务连接不上!
                 context.Response.End();
             }
             break;
         case "Menu":
             string UserId = RequestSession.GetSessionUser().UserId.ToString();//用户ID
             string strMenus = JsonHelper.DataTableToJson(sys_idao.GetMenuHtml(UserId), "MENU");
             context.Response.Write(strMenus);
             context.Response.End();
             break;
         default:
             break;
     }
 }