Ejemplo n.º 1
0
    /// <summary>
    /// 退回
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnReturn_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["Id"] != null)
        {
            Id = Convert.ToInt32(Request.QueryString["Id"]);
        }

        Hi.Model.DIS_Order OrderInfoModel = OrderInfoBll.GetModel(Id);

        if (OrderInfoModel != null)
        {
            if (OrderInfoModel.OState > (int)Enums.OrderState.未提交)
            {
                string sql = " update [DIS_Order] set [OState]=" + (int)Enums.OrderState.退回 + " where ID=" + Id;

                if (OrderInfoBll.UpdateOrderState(sql))
                {
                    //Utils.AddSysBusinessLog(this.CompID, "Order", Id.ToString(), "退回", "");
                    Bind();
                }
            }
        }
        else
        {
            JScript.ShowAlert(this, "数据不存在!");
        }
    }
Ejemplo n.º 2
0
    /// <summary>
    /// 复核
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnAudit_Click(object sender, EventArgs e)
    {
        Hi.BLL.PAY_PaymentBank   PAbll   = new Hi.BLL.PAY_PaymentBank();
        Hi.Model.PAY_PaymentBank PAmodel = PAbll.GetModel(this.KeyID);

        if (PAmodel != null)
        {
            PAmodel.Start = 1;
            bool falg = PAbll.Update(PAmodel);
            if (falg)
            {
                JScript.ShowAlert(this, "操作成功!");
                Bind();
            }
        }
    }
Ejemplo n.º 3
0
    /// <summary>
    /// 提交
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["Id"] != null)
        {
            Id = Convert.ToInt32(Request.QueryString["Id"]);
        }

        Hi.Model.DIS_Order OrderInfoModel = OrderInfoBll.GetModel(Id);

        if (OrderInfoModel != null)
        {
            if (OrderInfoModel.OState == (int)Enums.OrderState.未提交 || OrderInfoModel.OState == (int)Enums.OrderState.退回)
            {
                int OState = 1;
                if (OrderInfoModel.IsAudit == 1)
                {
                    //无需审核
                    OState = (int)Enums.OrderState.已审;
                }
                string sql = " update [DIS_Order] set [OState]=" + OState + " where ID=" + Id;

                if (OrderInfoBll.UpdateOrderState(sql))
                {
                    //Utils.AddSysBusinessLog(this.CompID, "Order", Id.ToString(), "提交", "");
                    Bind();
                }
            }
            else
            {
                JScript.ShowAlert(this, "数据状态不正确,不能进行审核!");
            }
        }
        else
        {
            JScript.ShowAlert(this, "数据不存在!");
        }
    }
Ejemplo n.º 4
0
 protected void btn_Del(object sender, EventArgs e)
 {
     Hi.Model.BD_Company comp = new Hi.BLL.BD_Company().GetModel(KeyID);
     if (comp != null)
     {
         if (comp.AuditState == 2)
         {
             JScript.ShowAlert(this, "已审核的企业不允许删除");
             return;
         }
         SqlTransaction Tran = DBUtility.SqlHelper.CreateStoreTranSaction();
         comp.dr         = 1;
         comp.ts         = DateTime.Now;
         comp.modifyuser = UserID;
         new Hi.BLL.BD_Company().Update(comp, Tran);
         int        userid                  = 0;
         List <int> ListUserid              = new List <int>();
         List <int> ListDelUserid           = new List <int>();
         List <Hi.Model.SYS_CompUser> luser = new Hi.BLL.SYS_CompUser().GetList("", " dr=0 and Compid=" + comp.ID + " and Utype in (3,4) and Ctype=1 ", "");
         foreach (Hi.Model.SYS_CompUser model in luser)
         {
             if (model.UType == 4)
             {
                 userid = model.UserID;
             }
             if (!ListUserid.Contains(model.UserID))
             {
                 List <Hi.Model.SYS_CompUser> ListCompUser = new Hi.BLL.SYS_CompUser().GetList("id", " dr=0 and Userid=" + model.UserID + " ", "");
                 if (ListCompUser.Count == 1)
                 {
                     ListDelUserid.Add(model.UserID);
                 }
                 ListUserid.Add(model.UserID);
             }
             model.dr         = 1;
             model.ts         = DateTime.Now;
             model.modifyuser = Common.UserID();
             new Hi.BLL.SYS_CompUser().Update(model, Tran);
         }
         string Phone = "";
         List <Hi.Model.SYS_Users> user = new Hi.BLL.SYS_Users().GetList("", " isnull(dr,0)=0 and id=" + userid + "", "");
         if (user.Count > 0)
         {
             Phone = user[0].Phone;
         }
         if (ListDelUserid.Count > 0)
         {
             List <Hi.Model.SYS_Users> ListUsers = new Hi.BLL.SYS_Users().GetList("", " dr=0 and id in(" + string.Join(",", ListDelUserid) + ")", "");
             foreach (Hi.Model.SYS_Users model in ListUsers)
             {
                 model.dr         = 1;
                 model.ts         = DateTime.Now;
                 model.modifyuser = Common.UserID();
                 new Hi.BLL.SYS_Users().Update(model, Tran);
             }
         }
         Tran.Commit();
         if (Request["type"] == "1")
         {
             if (string.IsNullOrWhiteSpace(Phone))
             {
                 Phone = Common.GetCompValue(comp.ID, "Phone").ToString();
             }
             string msg = "您所注册的企业:" + comp.CompName + "已注销!";
             Common.GetPhone(Phone, msg);
             JScript.AlertMsgMo(this, "删除成功", "function(){ window.location.href='CompAuditList.aspx'; }");
         }
         else
         {
             JScript.AlertMsgMo(this, "删除成功", "function() { window.location.href='CompList.aspx'; }");
         }
     }
 }
Ejemplo n.º 5
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        try
        {
            string dt         = DateTime.Now.ToString();
            string adminName  = Common.NoHTML(this.txtLoginId.Value.Trim());
            string adminPwd   = this.txtPwd.Value.Trim();
            string admintcode = Common.NoHTML(this.txtcode.Value.Trim());
            string Chckcode   = Session["CheckCode"] != null ? Session["CheckCode"].ToString() : "";
            if (Util.IsEmpty(adminName))
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('请输入用户名!');</script>");
                this.txtLoginId.Focus();
                return;
            }

            if (Util.IsEmpty(adminPwd))
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('请输入密码!');</script>");
                this.txtPwd.Focus();
                return;
            }

            if (admintcode == "")
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('请输入验证码!');</script>");
                return;
            }
            if (admintcode != Chckcode)
            {
                ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('验证码输入错误!');</script>");
                this.txtcode.Value = "";
                return;
            }
            if (DBHelper.IsOpen() == false)
            {
                JScript.ShowAlert(this, "系统无法连接数据库服务器,请联系管理员!");
                return;
            }

            Hi.Model.SYS_AdminUser model = new Hi.BLL.SYS_AdminUser().GetModelByName(adminName);

            if (model == null)
            {
                //登录录日志
                //Utils.EditLog("安全日志",adminName, "用户" + adminName + "登录管理系统失败,该用户不存在。", "系统安全模块", "Admin/login.aspx", 0, 0);

                ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('用户不存在!');</script>");
                this.txtLoginId.Focus();
                return;
            }
            else
            {
                if (Util.SHA1Encrypt(Util.SHA1Encrypt(model.LoginPwd)) == adminPwd)
                {
                    if (model.IsEnabled == 0)
                    {
                        ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('您的账户目前处在禁用状态,不能登录!');</script>");
                        return;
                    }
                    else
                    {
                        //保存登录信息

                        //保存Session信息
                        Session["AdminUser"]     = model;
                        Session["AdminUserDate"] = dt;
                        Session["UserType"]      = model.UserType;

                        //登录成功记录日志
                        Utils.EditLog("安全日志", adminName, "用户" + adminName + "登录管理系统成功。", "系统安全模块", "Admin/login.aspx", 0, 1, 0);
                        //Response.Redirect("index.aspx");

                        //Cookie记录登录名
                        HttpCookie cookie = new HttpCookie("LoginId", model.LoginName);
                        cookie.Expires  = DateTime.Now.AddDays(7);
                        cookie.HttpOnly = true;
                        Response.Cookies.Add(cookie);

                        //添加token验证
                        string MyTokenKey     = "__MYToken";
                        string MyUserNameKey  = "__MYUserName";
                        var    myTokenValue   = Guid.NewGuid().ToString("N");
                        var    responseCookie = new HttpCookie(MyTokenKey)
                        {
                            HttpOnly = true,
                            Value    = myTokenValue,
                            Expires  = DateTime.Now.AddDays(7)
                        };
                        Response.Cookies.Set(responseCookie);
                        Session[MyUserNameKey] = Util.md5(adminName + Util._salt);
                        Session[MyTokenKey]    = myTokenValue;

                        Response.Redirect("index.aspx");
                    }
                }
                else
                {
                    //登录录日志
                    Utils.EditLog("安全日志", adminName, "用户" + adminName + "登录管理系统失败,输入的密码错误。", "系统安全模块", "Admin/login.aspx", 0, 0, 1);
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "", "<script>alert('用户名或密码错误!');</script>");
                    this.txtPwd.Focus();
                    return;
                }
            }
        }
        catch (System.Threading.ThreadAbortException)
        {
            //捕捉线程终止异常   不处理
        }
        catch (Exception ex)
        {
            Tiannuo.LogHelper.LogHelper.Error("Error", ex);
            return;
        }
    }