Esempio n. 1
0
 protected void btnCommit_Click(object sender, EventArgs e)
 {
     if (ViewState["Client"] != null)
     {
         ClientInfoEntiy entity = (ClientInfoEntiy)ViewState["Client"];
         entity.Contact       = txtContact.Text.Trim();
         entity.Address       = txtAddress.Text.Trim();
         entity.PID           = txtPID.Text.Trim();
         entity.PKey          = txtKey.Text.Trim();
         entity.AlipayAccount = txtAlipayAccount.Text.Trim();
         HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
         if (dal.UpdateClient(entity))
         {
             Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('修改成功'); window.parent.closeDialog();", true);
             //ScriptManager.RegisterStartupScript(this, typeof(Page), "customJs", "alert('修改成功'); window.parent.closeDialog();", true);
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('修改失败,请重试');", true);
             //ScriptManager.RegisterStartupScript(this, typeof(Page), "customJs", "修改失败,请重试", true);
         }
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('系统错误,请重试');", true);
         //ScriptManager.RegisterStartupScript(this, typeof(Page), "customJs", "系统错误,请重试", true);
     }
 }
Esempio n. 2
0
 protected void btnCommit_Click(object sender, EventArgs e)
 {
     if (ViewState["Opr"] != null)
     {
         OprInfoEntiy entity = (OprInfoEntiy)ViewState["Opr"];
         entity.ClientID = ddlClient.SelectedValue;
         entity.IsAdmin  = int.Parse(ddlIsAdmin.SelectedValue);
         HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
         if (dal.UpdateOpr(entity))
         {
             Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('修改成功'); window.parent.closeDialog();", true);
             //ScriptManager.RegisterStartupScript(this, GetType(), "customJs", "alert('修改成功'); window.parent.closeDialog();", true);
         }
         else
         {
             Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('修改失败,请重试');", true);
             //ScriptManager.RegisterStartupScript(this, GetType(), "customJs", "修改失败,请重试", true);
         }
     }
     else
     {
         Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('系统错误,请重试');", true);
         //ScriptManager.RegisterStartupScript(this, typeof(Page), "customJs", "系统错误,请重试", true);
     }
 }
Esempio n. 3
0
        protected void btnCommit_Click(object sender, EventArgs e)
        {
            string agentName    = txtName.Text.Trim();
            string agentContact = txtContact.Text.Trim();
            string address      = txtAddress.Text.Trim();
            string tel          = txtTel.Text.Trim();

            string strType = ddlAgentType.SelectedValue;

            HYCashierDAL.CahierMgrDAL dal   = new HYCashierDAL.CahierMgrDAL();
            AgentInfoEntity           agent = new AgentInfoEntity();

            agent.Address   = address;
            agent.AgentID   = dal.GetAgentID();
            agent.AgentName = agentName;
            agent.AgentType = int.Parse(strType);
            agent.Contact   = agentContact;
            agent.Tel       = tel;
            agent.CreateUsr = LoginUser.ClientID;
            string js = "";

            if (dal.AddAgent(agent))
            {
                js = "alert('新增成功'); window.parent.closeDialog();";
            }
            else
            {
                js = "alert('新增失败');";
            }
            Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", js, true);
            // agent.UpAgentID
        }
Esempio n. 4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
         DataTable dt = dal.GetAllClient();
         ddlClient.DataSource     = dt;
         ddlClient.DataTextField  = "ClientName";
         ddlClient.DataValueField = "ClientID";
         ddlClient.DataBind();
         if (Request.Params["id"] != null)
         {
             string id = Request.Params["id"];
             //  HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
             IList <OprInfoEntiy> oprs = dal.GetOprInfo(id, null);
             if (oprs != null)
             {
                 ViewState["Opr"]         = oprs[0];
                 ddlIsAdmin.SelectedValue = oprs[0].IsAdmin.ToString();
                 txtName.Text             = oprs[0].OprName;
                 ddlClient.SelectedValue  = oprs[0].ClientID;
             }
         }
     }
 }
Esempio n. 5
0
        void LoadData()
        {
            string clientName = txtMerchantID.Value.Trim();

            // string contactName = txtContact.Value.Trim();

            HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();

            int?   count    = 0;
            string clientID = string.Empty;

            if (Session["ClientID"].ToString() == "180000")
            {
                clientID = null;
            }
            else
            {
                clientID       = Session["ClientID"].ToString();
                btnAdd.Visible = false;
            }
            count = dal.GetClientCount(clientID, clientName);
            if (count == null)
            {
                AspNetPager1.RecordCount = 0;
            }
            else
            {
                AspNetPager1.RecordCount = (int)count;
            }

            DataTable dt = dal.GetClientList(clientID, clientName, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);

            dataGrid.DataSource = dt;
            dataGrid.DataBind();
        }
Esempio n. 6
0
        protected void btnCommit_Click(object sender, EventArgs e)
        {
            string name = txtName.Text.Trim();
            // string clientID = ddlClient.SelectedValue;
            string       clientID = txtClient.Value;
            string       js       = "";
            OprInfoEntiy entity   = new OprInfoEntiy();

            entity.OprName  = name;
            entity.ClientID = clientID;
            entity.IsAdmin  = int.Parse(ddlIsAdmin.SelectedValue);
            entity.OprPWD   = HYCashierDAL.CryptographyHelper.MD5Encrypt("123456");
            HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
            string id = dal.GetOprID();

            entity.OprID = id;
            if (dal.AddOpr(entity))
            {
                js = "alert('新增成功'); window.parent.closeDialog();";
            }
            else
            {
                js = "alert('新增失败');";
            }
            Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", js, true);
            //ScriptManager.RegisterStartupScript(this, GetType(), "customJs", js, true);
        }
Esempio n. 7
0
        protected void dataGrid_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string id   = e.CommandArgument.ToString();
            string name = e.CommandName.ToString();

            if (name == "cmdUpdate")
            {
                string js = "update('" + id + "');";
                ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "customJs", js, true);
                //ScriptManager.RegisterStartupScript(this, typeof(Page), "customJs", js, false);
            }
            else
            {
                //cmdDelete
                HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
                if (dal.DeleteClient(id))
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "customJs", "alert('删除成功');", true);
                    LoadData();
                }
                else
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "customJs", "alert('删除失败,请重试')", true);
                }
            }
        }
Esempio n. 8
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";

            string res  = "";
            string type = "";

            if (context.Request.Params["type"] != null)
            {
                type = context.Request.Params["type"];
            }

            if (type == "client")
            {
                string cid = "";
                if (context.Request.Params["cid"] != null)
                {
                    cid = context.Request.Params["cid"];
                }
                HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
                DataTable dt = dal.GetClient(cid);
                if (dt != null && dt.Rows.Count > 0)
                {
                    IList <ClientInfoEntiy> clients = DataTableUtility.ToList <ClientInfoEntiy>(dt);
                    res = JsonConvert.SerializeObject(clients);
                }
            }
            else if (type == "shop")
            {
                HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
                DataTable dt = dal.GetAllOpr("");
                if (dt != null && dt.Rows.Count > 0)
                {
                    IList <ClientInfoEntiy> clients = DataTableUtility.ToList <ClientInfoEntiy>(dt);
                    res = JsonConvert.SerializeObject(clients);
                }
            }
            else if (type == "agent")
            {
                HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
                DataTable dt = dal.GetAllOpr("");
                if (dt != null && dt.Rows.Count > 0)
                {
                    IList <ClientInfoEntiy> clients = DataTableUtility.ToList <ClientInfoEntiy>(dt);
                    res = JsonConvert.SerializeObject(clients);
                }
            }


            context.Response.Write(res);
        }
Esempio n. 9
0
        protected void btnDelete_Command(object sender, CommandEventArgs e)
        {
            string id   = e.CommandArgument.ToString();
            string name = e.CommandName.ToString();

            HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
            if (dal.DeleteOpr(id))
            {
                ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "customJs", "alert('删除成功');", true);
                LoadData();
            }
            else
            {
                ScriptManager.RegisterStartupScript(UpdatePanel1, typeof(UpdatePanel), "customJs", "alert('删除失败,请重试')", true);
            }
        }
Esempio n. 10
0
        void LoadData()
        {
            string agentName = txtName.Text.Trim();
            string id        = txtID.Text.Trim();
            string strType   = ddlAgentType.SelectedValue;
            // string contactName = txtContact.Value.Trim();
            int iType = -1;

            if (!string.IsNullOrEmpty(strType))
            {
                iType = int.Parse(strType);
            }
            HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();

            int?   count    = 0;
            string clientID = string.Empty;

            if (Session["ClientID"].ToString() == "180000")
            {
                clientID = null;
            }
            else
            {
                clientID       = Session["ClientID"].ToString();
                btnAdd.Visible = false;
            }
            count = dal.GetAgentCount(id, agentName, "", iType);
            if (count == null)
            {
                AspNetPager1.RecordCount = 0;
            }
            else
            {
                AspNetPager1.RecordCount = (int)count;
            }

            DataTable dt = dal.GetAgentList(id, agentName, "", iType, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);

            dataGrid.DataSource = dt;
            dataGrid.DataBind();
        }
Esempio n. 11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
                string clientID = string.Empty;
                if (Session["ClientID"].ToString() == "180000")
                {
                    clientID = null;
                }
                else
                {
                    clientID = Session["ClientID"].ToString();
                }
                int oprCount    = dal.GetOprCount(clientID, "", "", "");
                int clientCount = dal.GetClientCount(clientID, "");
                lblClientCount.Text = clientCount.ToString();

                lblOprCount.Text = oprCount.ToString();
            }
        }
Esempio n. 12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Request.Params["id"] != null)
         {
             string id = Request.Params["id"];
             HYCashierDAL.CahierMgrDAL dal     = new HYCashierDAL.CahierMgrDAL();
             IList <ClientInfoEntiy>   clients = dal.GetClientInfo(id, null);
             if (clients != null)
             {
                 ViewState["Client"]   = clients[0];
                 txtAddress.Text       = clients[0].Address;
                 txtContact.Text       = clients[0].Contact;
                 txtName.Text          = clients[0].ClientName;
                 txtPID.Text           = clients[0].PID;
                 txtKey.Text           = clients[0].PKey;
                 txtAlipayAccount.Text = clients[0].AlipayAccount;
             }
         }
     }
 }
Esempio n. 13
0
        void LoadData()
        {
            string clientName = txtName.Value.Trim();

            string clientID = txtMerchantID.Text.Trim();

            string            startDate = txtStartTime.Value.Trim();
            string            oprID     = txtOprID.Value.Trim();
            string            endDate   = txtEndTime.Value.Trim();
            WebTradeCondition condition = new WebTradeCondition();

            condition.ClientID = clientID;
            if (!string.IsNullOrEmpty(startDate))
            {
                condition.StartDate = DateTime.Parse(startDate);
            }
            if (!string.IsNullOrEmpty(endDate))
            {
                condition.EndDate = DateTime.Parse(endDate).AddDays(1);
            }
            HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
            condition.OprID = oprID;
            int?count = 0;

            count = dal.GetTradeInfoCount(condition);
            if (count == null)
            {
                AspNetPager1.RecordCount = 0;
            }
            else
            {
                AspNetPager1.RecordCount = (int)count;
            }

            DataTable dt = dal.GetTradeInfoPager(condition, AspNetPager1.PageSize, AspNetPager1.CurrentPageIndex);

            dataGrid.DataSource = dt;
            dataGrid.DataBind();
        }
Esempio n. 14
0
        void LoadData()
        {
            string clientName = txtMerchantName.Value.Trim();

            string oprName = txtUsrName.Value.Trim();

            HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();

            int?   count    = 0;
            string clientID = string.Empty;

            if (!string.IsNullOrEmpty(txtMerchantID.Value.Trim()))
            {
                clientID = txtMerchantID.Value;
            }
            //if (Session["ClientID"].ToString() == "180000")
            //{
            //    clientID = null;
            //}
            //else
            //{
            //    clientID = Session["ClientID"].ToString();
            //}
            count = dal.GetOprCount(clientID, clientName, null, oprName);
            if (count == null)
            {
                AspNetPager1.RecordCount = 0;
            }
            else
            {
                AspNetPager1.RecordCount = (int)count;
            }

            DataTable dt = dal.GetOprList(clientID, clientName, null, oprName, AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);

            dataGrid.DataSource = dt;
            dataGrid.DataBind();
        }
Esempio n. 15
0
        protected void btnCommit_Click(object sender, EventArgs e)
        {
            if (txtPwd1.Text.Trim() != txtPwd2.Text.Trim())
            {
                Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('密码不匹配,请重新输入');", true);

                return;
            }
            if (Session["LoginUser"] != null)
            {
                OprInfoEntiy usr = (OprInfoEntiy)Session["LoginUser"];
                if (usr != null)
                {
                    if (MD5Encrypt(txtOldPwd.Text.Trim()) != usr.OprPWD)
                    {
                        Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('原密码不正确,请重新输入');", true);

                        return;
                    }

                    HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
                    if (dal.UpdateOprPwd(usr.OprID, MD5Encrypt(txtPwd1.Text.Trim())))
                    {
                        Session["LoginUser"] = null;
                        Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('修改成功');parent.closeDialog();", true);
                    }
                    else
                    {
                        Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('修改失败');", true);
                    }
                }
            }
            else
            {
                Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "customJs", "alert('系统错误,请重试');", true);
            }
        }
Esempio n. 16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                HYCashierDAL.CahierMgrDAL dal = new HYCashierDAL.CahierMgrDAL();
                //DataTable dt = dal.GetAllClient();
                //ddlClient.DataSource = dt;

                //ddlClient.DataTextField = "ClientName";
                //ddlClient.DataValueField = "ClientID";
                //ddlClient.DataBind();
                string clientID = string.Empty;
                if (Session["ClientID"].ToString() == "180000")
                {
                    clientID = null;
                }
                else
                {
                    clientID = Session["ClientID"].ToString();
                    //ddlClient.SelectedValue = clientID;
                    //ddlClient.Enabled = false;
                }
            }
        }