Exemple #1
0
 /// <summary>
 /// 冻结账户
 /// </summary>
 public void UserFreeZing(string UrId)
 {
     userManage.EditErrorloginLockTimeByPK(UrId, "5", DateTime.Now); // 修改输错次数
     userManage.EditStateByPk(UrId, "2");                            //  将状态改为冻结
     Jswork.Alert("亲, 您的账户已经被冻结请联系管理员或24小时后自动解冻 解冻时间为:" + DateTime.Now.AddDays(1).ToString("yyyy-MM-dd hh:mm:ss") + "", this.Page);
     InsertLog("用户账号冻结", string.Format("id:{0},datetime:{1}", UrId, DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")), 0, GetPlatformIdByValue(1));
 }
        /// <summary>
        /// 行事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void gvPlatform_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            string Platformid = e.CommandName;             //  平台ID

            if (e.CommandArgument.ToString() == "CloseWh") // 关闭维护
            {
                if (NxPlatformMO.PutPfIsRepairByPK(Platformid, "0") > 0)
                {
                    InsertLog("关闭维护", string.Format("Platformname:{0},id:{1}", this.ddlPf.SelectedItem.Text, this.ddlPf.SelectedValue), 14, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert("关闭维护成功", "PlatformMaintain.aspx");
                }
                else
                {
                    Jswork.Alert("关闭维护失败!");
                }
            }
            else if (e.CommandArgument.ToString() == "CloseGg") // 关闭公告
            {
                if (NxPlatformMO.PutPfIsNewShowByPK(Platformid, "0") > 0)
                {
                    InsertLog("修改平台维护信息", string.Format("Platformname:{0},id:{1}", this.ddlPf.SelectedItem.Text, this.ddlPf.SelectedValue), 14, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert("关闭公告", "PlatformMaintain.aspx");
                }
                else
                {
                    Jswork.Alert("关闭公告失败!");
                }
            }
        }
Exemple #3
0
        /// <summary>
        /// 权限复制或转移
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnAuthorityCopy_Click(object sender, EventArgs e)
        {
            //一次只能修改一条记录
            if (this.SelectCount() == 1)
            {
                string strId = string.Empty;
                foreach (GridViewRow gvrow in gvUsers.Rows)
                {
                    CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                    if (CheckBox.Checked)
                    {
                        strId = this.gvUsers.DataKeys[gvrow.RowIndex]["Ur_id"].ToString();
                    }
                }
                Response.Redirect(string.Format("AuthorityCopy.aspx?State=U&Urid={0}&Action=1", strId));
            }

            else if (this.SelectCount() == 0)
            {
                //Jswork.Alert("请选择一条记录进行修改", this.Page);

                this.divAlert.Visible = true;
                //this.lblAlert.Text = Resources.Resource.tip_one_modify; //"请选择一条记录进行修改";
                Jswork.Alert(Resources.Resource.tip_one_modify, this.Page);
            }
            else
            {
                //Jswork.Alert("一次只能修改一条记录", this.Page);

                this.divAlert.Visible = true;
                Jswork.Alert(Resources.Resource.tip_only_modify, this.Page);
                //this.lblAlert.Text = Resources.Resource.tip_only_modify; //"一次只能修改一条记录";
            }
        }
Exemple #4
0
        /// <summary>
        /// 删除
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDel_Click(object sender, EventArgs e)
        {
            String strUrids = string.Empty;
            String strNames = string.Empty;

            foreach (GridViewRow gvrow in gvUsers.Rows)
            {
                CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                if (CheckBox.Checked)
                {
                    strUrids += this.gvUsers.DataKeys[gvrow.RowIndex]["Mg_id"].ToString() + "|";
                }
            }
            if (strUrids == "" && strUrids.Length == 0)
            {
                //Jswork.Alert("请至少选择一条记录进行删除", this.Page);

                this.divAlert.Visible = true;
                //this.lblAlert.Text = Resources.Resource.tip_only_delete; //"请至少选择一条记录进行删除";
                ShowCommonDlg("请至少选择一条记录进行删除");

                return;
            }

            strUrids = strUrids.TrimEnd('|');

            UsersMO usersMO = new UsersMO();

            int iSuccess = 0;

            for (int i = 0; i < strUrids.Split('|').Length; i++)
            {
                StringBuilder strWhere = new StringBuilder();
                strWhere.Append(" 1=1");
                IList <MySqlParameter> parm = new List <MySqlParameter>();

                strWhere.Append(" and Mg_id =@Mg_id");
                parm.Add(new MySqlParameter("@Mg_id", strUrids.Split('|')[i]));
                if (goodManage.DelGood(strUrids.Split('|')[i]) > 0)
                //if (userManage.DelUsers("Ur_del = 1", string.Format(" Ur_id = '{0}'", strUrids.Split('|')[i])) > 0)
                {
                    //插入操作日志表
                    InsertLog("删除商品", string.Format("goodid:{0}", strNames.Split(',')[i]), 0, "");

                    iSuccess += 1;
                }
            }

            if (iSuccess > 0)
            {
                //Jswork.Alert("删除成功", this.Page);
                Jswork.Alert(Resources.Resource.tip_delete_success, this.Page);

                this.BindUsers();
            }
        }
Exemple #5
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            String strPmids   = string.Empty;
            string strPmnames = string.Empty;

            foreach (GridViewRow gvrow in gvPermissions.Rows)
            {
                CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                if (CheckBox.Checked)
                {
                    strPmids   += this.gvPermissions.DataKeys[gvrow.RowIndex]["Pm_id"].ToString() + "|";
                    strPmnames += this.gvPermissions.DataKeys[gvrow.RowIndex]["Pm_name"].ToString() + ",";
                }
            }
            if (strPmids == "" && strPmids.Length == 0)
            {
                //Jswork.Alert("请至少选择一条记录进行删除", this.Page);

                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.tip_only_delete;//"请至少选择一条记录进行删除";

                return;
            }

            strPmids = strPmids.TrimEnd('|');

            PermissionsMO pmMO = new PermissionsMO();

            int iSuccess = 0;

            for (int i = 0; i < strPmids.Split('|').Length; i++)
            {
                StringBuilder strWhere = new StringBuilder();
                strWhere.Append(" 1=1");
                IList <MySqlParameter> parm = new List <MySqlParameter>();

                strWhere.Append(" and Pm_id =@Cnname");
                parm.Add(new MySqlParameter("@Cnname", strPmids.Split('|')[i]));
                if (pmManage.DelPermissionss("Pm_del = 1", strWhere.ToString(), parm) > 0)

                //if (pmManage.DelPermissionss("Pm_del = 1", string.Format(" Pm_id = '{0}'", strPmids.Split('|')[i])) > 0)
                {
                    InsertLog(Resources.Resource.Delete_function, string.Format("permissionsname:{0},id:{1}", strPmnames.Split(',')[i], strPmids.Split('|')[i]), 12, GetPlatformIdByValue(1));

                    iSuccess += 1;
                }
            }

            if (iSuccess > 0)
            {
                Jswork.Alert(Resources.Resource.tip_delete_success, this.Page);

                this.BindPermissions();
            }
        }
        protected void btnOK_Click(object sender, EventArgs e)
        {
            NxPlatformEO NxPlatformEO = new NxPlatformEO();

            NxPlatformEO = PfManage.GetPlatformByPK(this.ddlPf.SelectedValue);
            if (this.rblStatus.SelectedValue == "0")
            {
                NxPlatformEO.PfIsRepair  = "1"; //开启维护
                NxPlatformEO.PfIsNewShow = "0"; //不显示新功能说明
            }
            else
            {
                NxPlatformEO.PfIsNewShow = "1"; //显示新功能
                NxPlatformEO.PfIsRepair  = "0"; //关闭维护

                if (string.IsNullOrEmpty(this.txtPfnewFunction.Text.Trim()))
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = "请输入新功能说明";
                    this.txtPfnewFunction.Focus();
                    CloseDivImplementation();
                    return;
                }
                else
                {
                    NxPlatformEO.PfNewFunction = this.txtPfnewFunction.Text.Trim();
                }

                if (string.IsNullOrEmpty(this.txtEndTime.Text.Trim()))
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = "请选择维护结束时间";
                    CloseDivImplementation();
                    return;
                }
                else
                {
                    NxPlatformEO.PfNewEndTime = Convert.ToDateTime(txtEndTime.Text.Trim());
                }
            }

            if (PfManage.EditPlatform(NxPlatformEO) > 0)
            {
                //插入操作日志
                InsertLog("修改平台维护信息", string.Format("Platformname:{0},id:{1}", this.ddlPf.SelectedItem.Text, this.ddlPf.SelectedValue), 14, GetPlatformIdByValue(1));
                CloseDivImplementation();
                Jswork.Alert("平台维护信息修改成功", "PlatformMaintain.aspx");
            }
            else
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = "平台维护信息修改失败";
            }
            CloseDivImplementation();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (GetUserID() == "")
     {
         Jswork.Alert("亲,请先登录!", "top", ConfigurationManager.AppSettings["WebLoginURL"].ToString());
     }
     if (!IsPostBack)
     {
         BindPlatform();
     }
 }
        //wndou.common.Encrypt MD5 = new wndou.common.Encrypt();

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetUserID() == "")
            {
                Jswork.AlertAndRedirect("亲,请先登录!", ConfigurationManager.AppSettings["WebLoginURL"].ToString(), this.Page);
                return;
            }

            if (!IsPostBack)
            {
                this.LoadUser();
            }
        }
Exemple #9
0
        protected void btnDel_Click(object sender, EventArgs e)
        {
            String strPfids   = string.Empty;
            string strPfnames = string.Empty;

            foreach (GridViewRow gvrow in gvChannel.Rows)
            {
                CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                if (CheckBox.Checked)
                {
                    strPfids   += this.gvChannel.DataKeys[gvrow.RowIndex]["Cn_id"].ToString() + "|";
                    strPfnames += this.gvChannel.DataKeys[gvrow.RowIndex]["Cn_channelId"].ToString() + ",";
                }
            }
            if (strPfids == "" && strPfids.Length == 0)
            {
                //Jswork.Alert("请至少选择一条记录进行删除", this.Page);

                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.tip_only_delete;//"请至少选择一条记录进行删除";

                return;
            }

            strPfids = strPfids.TrimEnd('|');

            NxPlatformMO pmMO = new NxPlatformMO();

            int iSuccess = 0;

            for (int i = 0; i < strPfids.Split('|').Length; i++)
            {
                if (channelMessage.Del(strPfids.Split('|')[i]) > 0)
                {
                    InsertLog(Resources.Resource.Delete_channel, string.Format("Cn_name:{0},Cn_id:{1}", strPfnames.Split(',')[i], strPfids.Split('|')[i]), -5, GetPlatformIdByValue(1));
                    iSuccess += 1;
                }
            }

            if (iSuccess > 0)
            {
                Jswork.Alert(Resources.Resource.tip_delete_success, this.Page);

                this.BindChannel();
            }
        }
Exemple #10
0
        bool IsRepare = false; //  是否有维护权限

        protected void Page_Load(object sender, EventArgs e)
        {
            if (GetUserID() == "")
            {
                Jswork.Alert("亲,请先登录!", "top", ConfigurationManager.AppSettings["WebLoginURL"].ToString());
            }
            //IList<MySqlParameter> parm = new List<MySqlParameter>();
            //parm.Add(new MySqlParameter("@Cnname", "%" + this.txtCnname.Text.Trim() + "%"));
            DataRow[] dr = GetRoleTable().Select("Rl_name = '" + ConfigurationManager.AppSettings["WeiHuRoleName"].ToString() + "'");
            if (dr.Length > 0) // 证明有工程师权限
            {
                IsRepare = true;
            }

            if (!IsPostBack)
            {
                BindList(1);
            }
        }
        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            UsersEO usersEO = new UsersEO();

            usersEO = userManage.GetUserByPK(GetUserID());

            if (usersEO.UrPass != MdUtil.ToMd5Hash(this.txtPass.Text.Trim()))
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = "当前密码不正确";
                CloseDivImplementation();
                return;
            }

            if (this.txtNewPass.Text.Trim() != this.txtRePass.Text.Trim())
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = "两次输入密码不一致";
                CloseDivImplementation();
                return;
            }

            usersEO.UrPass = MdUtil.ToMd5Hash(this.txtNewPass.Text.Trim());//密码MD5加密

            if (userManage.EditUser(usersEO) > 0)
            {
                //插入操作日志
                InsertLog("修改用户", string.Format("username:{0},id:{1}", usersEO.UrName, usersEO.UrId), 2, GetPlatformIdByValue(1));

                Jswork.Alert("用户密码修改成功", "UsersList.aspx");
            }
            else
            {
                //Jswork.Alert("用户信息修改失败", this.Page);
                this.divAlert.Visible = true;
                this.lblAlert.Text    = "用户密码修改失败";
            }
            CloseDivImplementation();
        }
Exemple #12
0
        public void ProcessRequest(HttpContext context)
        {
            if (basePage.GetUserID() == "")
            {
                Jswork.Alert("亲,请先登录!", "top", ConfigurationManager.AppSettings["WebLoginURL"].ToString());
            }
            int result = 0;

            try
            {
                string id      = context.Request["id"].ToString();
                string state   = context.Request["state"].ToString();
                string message = context.Request["message"].ToString();


                if (id != "" && state != "")
                {
                    if (feedBackMO.PutFbStateByPK(Convert.ToInt32(id), state) > 0)                                                                                                                    // 修改state
                    {
                        feedBackMO.PutFbSolveUserByPK(Convert.ToInt32(id), basePage.GetUserID());                                                                                                     // 修改人
                        feedBackMO.PutFbSolveTimeByPK(Convert.ToInt32(id), DateTime.Now);                                                                                                             //修改时间
                        feedBackMO.PutFbSolvedescriptionByPK(Convert.ToInt32(id), message);                                                                                                           //修改管理员回复
                        basePage.InsertLog("问题反馈管理员回复", "Fb_state:" + state + ",Fb_addTime:" + DateTime.Now + ",Fb_solvedescription:" + message + ",id:" + id, -3, basePage.GetPlatformIdByValue(1)); //  添加日志
                        result = 1;
                    }
                    else
                    {
                        result = 0;
                    }
                }
            }
            catch
            {
                result = 0;
            }

            context.Response.ContentType = "text/plain";
            context.Response.Write(result);
        }
        /// <summary>
        /// 判断是否有访问该游戏的权限
        /// </summary>
        /// <param name="Pf_id"></param>
        /// <param name="Pf_name"></param>
        ///  /// <param name="Pf_text1">英文的备用字段</param>
        /// <param name="Pf_imgUrl"></param>
        /// <param name="id"></param>
        /// <param name="Pf_isRepair"></param>
        /// <param name="Pf_imgWaterUrl"></param>
        /// <returns></returns>
        public string GetMessage(object Pf_id, object Pf_name, object Pf_text1, object Pf_imgUrl, object id, object Pf_isRepair, object Pf_imgWaterUrl)
        {
            try
            {
                //  判断图片地址是否存在
                string filename = Server.MapPath(Pf_imgUrl.ToString());
                if (!File.Exists(filename)) // 不存在
                {
                    Pf_imgWaterUrl = "Themes/Images/lianzhong.jpg";
                }

                DataRow[] dr = GetRoleTable().Select("Rl_name = '" + ConfigurationManager.AppSettings["WeiHuRoleName"].ToString() + "'");
                if (dr.Length > 0) // 证明有工程师权限
                {
                    Pf_isRepair = "0";
                }

                if (Pf_isRepair.ToString() == "0" || Pf_isRepair.ToString() == "") // 正常
                {
                    if (id.ToString() == "0")                                      // 图片
                    {
                        if (IsLanguageEng())
                        {
                            return("<a href=\"javascript:void()\" onclick=\"onLinkPlatform('" + Pf_text1 + "','" + Pf_id + "')\"><div style=\" background:url('" + Pf_imgWaterUrl + "'); width: 120px; height: 120px; border: #33aa33; background-size: cover; \" id='" + Pf_id + "'/></div></a> <script>yj(\"" + Pf_id + "\");</script>");
                        }
                        else
                        {
                            return("<a href=\"javascript:void()\" onclick=\"onLinkPlatform('" + Pf_name + "','" + Pf_id + "')\"><div style=\" background:url('" + Pf_imgWaterUrl + "'); width: 120px; height: 120px; border: #33aa33; background-size: cover; \" id='" + Pf_id + "'/></div></a> <script>yj(\"" + Pf_id + "\");</script>");
                        }
                    }
                    else if (id.ToString() == "1") // 汉字 '" + Pf_imgUrl + "'
                    {
                        if (IsLanguageEng())
                        {
                            return("<a style=\" color:White; text-size:8px; text-decoration:none; \" href=\"javascript:void()\" onclick=\"onLinkPlatform('" + Pf_text1 + "','" + Pf_id + "')  \"> " + Pf_text1 + "</a>");
                        }
                        else
                        {
                            return("<a style=\" color:White; text-size:8px; text-decoration:none; \" href=\"javascript:void()\" onclick=\"onLinkPlatform('" + Pf_name + "','" + Pf_id + "')  \"> " + Pf_name + "</a>");
                        }
                    }
                }
                else // 维护
                {
                    if (id.ToString() == "0") // 图片
                    {
                        return("<a href=\"javascript:void()\" onclick=\"alert('系统维护中,请稍后再试!\"><div style=\" background:url('Themes/Images/lianzhong.jpg'); width: 120px; height: 120px; border: #33aa33; background-size: cover; \" id='" + Pf_id + "'/></div></a> <script>yj(\"" + Pf_id + "\");</script>");
                    }
                    else if (id.ToString() == "1") // 汉字 '" + Pf_imgUrl + "'
                    {
                        if (IsLanguageEng())
                        {
                            return("<span style='color:write'>" + Pf_text1 + "(维护中)" + "</span>");
                        }
                        else
                        {
                            return("<span style='color:write'>" + Pf_name + "(维护中)" + "</span>");
                        }
                    }
                }
                return("");
            }
            catch
            {
                CloseDivImplementation();
                Jswork.Alert("系统异常,请与管理员联系!", "top", ConfigurationManager.AppSettings["WebLoginURL"].ToString());
                return("");
            }
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            string lasttime = "";

            if (txtTitle.Text == "")
            {
                this.divAlert.Visible = true;
                lblAlert.Text         = "请输入反馈标题!";
                CloseDivImplementation(); // 关闭等待框
                return;
            }
            else if (txtMessage.Text == "")
            {
                this.divAlert.Visible = true;
                lblAlert.Text         = "请输入反馈内容!";
                CloseDivImplementation(); // 关闭等待框
                return;
            }
            //foreach (FeedbackEO feedBackEOLast in feedBackMO.GetTopSort("Fb_state =0 and Fb_del = 0 and Fb_addUser='******'", 1, "Fb_addTime desc"))
            foreach (FeedbackEO feedBackEOLast in feedBackMO.GetTopSort("Fb_state =0 and Fb_del = 0 and Fb_addUser=@GetUserID", 1, "Fb_addTime desc", GetUserID()))
            {
                lasttime = feedBackEOLast.FbAddTime.ToString();
            }

            if (lasttime != "")
            {
                TimeSpan timespan = new TimeSpan(0, 1, 0);
                if (DateTime.Now - Convert.ToDateTime(lasttime) < timespan)
                {
                    this.divAlert.Visible = true;
                    lblAlert.Text         = "亲,您操作过于频繁,请1分钟后尝试!";
                    CloseDivImplementation(); // 关闭等待框
                    return;
                }
            }
            this.divAlert.Visible = false;
            FeedbackEO feedBackEO = new FeedbackEO();

            feedBackEO.FbTitle       = txtTitle.Text;
            feedBackEO.FbDescription = txtMessage.Text;
            UpFile upfile  = new UpFile();
            string a       = "";
            string ImgName = upfile.UpLoadImage(FileUpload1, GetBigGuid(), this.Page, out a, "../File/FeedBackFile/");

            feedBackEO.FbUrl     = ImgName;
            feedBackEO.FbDel     = "0";
            feedBackEO.FbState   = "0";
            feedBackEO.PfId      = ddlPf.Text;
            feedBackEO.FbAddUser = GetUserID();
            feedBackEO.FbAddTime = DateTime.Now;

            if (feedBackMO.Add(feedBackEO) > 0)
            {
                InsertLog("问题反馈", GetDisPlayName(feedBackEO), -2, GetPlatformIdByValue(1)); //  添加日志
                Jswork.AlertAndRedirect("问题提交成功,我们会尽快处理!", "FeedBackList.aspx", this.Page);
            }
            else
            {
                Jswork.AlertAndRedirect("问题提交声失败,请与管理员联系!", "FeedBackList.aspx", this.Page);
            }
            CloseDivImplementation();
        }
Exemple #15
0
        protected void btnCharge_Click(object sender, EventArgs e)
        {
            //var recharData = { "action": "IDIP_DO_PAY_CASH_REQ", "remark": "2017100402", "dis_uin": 10372, "src_uin": 10372, "role_name": "niuniu", "us_source": "2", "amount": "20", "ui_ip": "127.1.1.1", "gameId": "hlynzy", "sz_desc": "充值" };
            //var strData = JSON.stringify(recharData);

            string payMoney      = "";
            string payWapType    = "4";
            string payOutTradeNo = DateTime.Now.ToString("yyyyMMddhhmmss");
            string paySubject    = "";

            if (this.SelectCount() == 1)
            {
                string strId = string.Empty;
                foreach (GridViewRow gvrow in gvUsers.Rows)
                {
                    CheckBox CheckBox = gvrow.FindControl("chbSelect") as CheckBox;
                    if (CheckBox.Checked)
                    {
                        payMoney   = this.gvUsers.DataKeys[gvrow.RowIndex]["Mg_price"].ToString();
                        paySubject = this.gvUsers.DataKeys[gvrow.RowIndex]["Mg_Name"].ToString();
                    }
                }
            }
            else if (this.SelectCount() == 0)
            {
                //Jswork.Alert("请选择一条记录进行修改", this.Page);
                this.divAlert.Visible = true;
                //this.lblAlert.Text = "请选择一条要购买的商品"; //"";
                Jswork.Alert("请选择一条要购买的商品", this.Page);
                return;
            }
            else
            {
                //Jswork.Alert("一次只能修改一条记录", this.Page);

                this.divAlert.Visible = true;
                //this.lblAlert.Text = "一次只能购买一个商品"; //"一次只能修改一条记录";
                Jswork.Alert("一次只能购买一个商品", this.Page);
                return;
            }

            //int payMoneyNum = Convert.ToInt32(payMoney) * 100;
            string curuserId = Session["currentgameid"].ToString();
            string trandeNo  = PubFuncs.GenerateOrderNumber();
            string payUrl    = PayUlity.ZYFPay("9", payWapType, trandeNo, paySubject, curuserId);

            //this.divAlert.Visible = true;
            //this.lblAlert.Text = payOutTradeNo; //"一次只能修改一条记录";
            if (!string.IsNullOrEmpty(payUrl))
            {
                Response.Redirect(payUrl);
            }

            /*
             * var iUrl = "http://192.168.1.101:8888";
             *
             * using (var client = new WebClient())
             * {
             *
             *  Dictionary<string, string> dic = new Dictionary<string, string>();
             *  dic["action"] = "IDIP_DO_PAY_CASH_REQ";
             *  dic["remark"] = "2017100402";
             *  dic["dis_uin"] = "10372";
             *  dic["src_uin"] = "10372";
             *  dic["role_name"] = "niuniu";
             *  dic["us_source"] = "2";
             *  dic["amount"] = "20";
             *  dic["ui_ip"] = "127.1.1.1";
             *  dic["gameId"] = "hlynzy";
             *  dic["sz_desc"] = "充值";
             *  string json = new JavaScriptSerializer().Serialize(dic);
             *
             *  string responseStr = HttpClientUlity.PostJsonData(iUrl, json);
             *
             *  this.divAlert.Visible = true;
             *  this.lblAlert.Text = Resources.Resource.diamond_charge_suc; //"钻石充值成功";
             * }
             */
        }
Exemple #16
0
        /// <summary>
        /// 添加、修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.CheckForms() == false)
            {
                CloseDivImplementation();
                return;
            }
            if (this.CheckIsNum(this.txtSort.Text.Trim()) == false)
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.Please_enter_a_sort_number;//"请输入排序数字";
                CloseDivImplementation();
                return;
            }

            ModuleEO            mdEO  = new ModuleEO();            //模块信息
            ModulepermissionsEO mdpEO = new ModulepermissionsEO(); //模块功能关系

            if (Request.QueryString["State"] == "U")
            {
                mdEO = mdManage.GetModuleByPK(Request.QueryString["ModuleID"]);
            }

            mdEO.MdName           = this.txtMdName.Text;
            mdEO.MdAddress        = this.txtAddress.Text;
            mdEO.PfId             = this.ddlPf.SelectedValue;
            mdEO.MdUseFlag        = this.rblState.SelectedValue;
            mdEO.MdNotes          = this.txtNotes.Text;
            mdEO.MdFiledOrder     = Convert.ToInt32(this.txtSort.Text.Trim()); //备用字段:模块排序
            mdEO.MdExistsTreeView = this.rblMdExist.SelectedValue;
            mdEO.MdImgUrl         = @"../Images/farmework/ico11.gif";
            mdEO.MdText1          = this.txtMdName_en.Text;//英文



            //创建父模块
            if (Request.QueryString["State"] == "AF")
            {
                //判断模块名称是否存在
                if (this.CheckModuleName() == false)
                {
                    //Jswork.Alert("父模块名称 " + this.txtMdName.Text.Trim() + " 已存在", this.Page);

                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = this.ddlPf.SelectedItem.Text + Resources.Resource.Name_of_the_parent_module + this.txtMdName.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }

                //模块信息数据
                mdEO.MdId         = GetBigGuid();
                mdEO.MdParentid   = "0";
                mdEO.MdDeleteFlag = "0";
                mdEO.MdAddTime    = DateTime.Now;

                //模块功能关系数据
                for (int i = 0; i < this.cblPermissionsTatal.Items.Count; i++)
                {
                    if (this.cblPermissionsTatal.Items[i].Selected)
                    {
                        mdpEO.MdId      = mdEO.MdId;
                        mdpEO.PmId      = this.cblPermissionsTatal.Items[i].Value;
                        mdpEO.MpUser    = GetUserID();
                        mdpEO.MpAddTime = DateTime.Now.ToShortTimeString();

                        mdpManage.AddModulePermissions(mdpEO);
                    }
                }

                if (mdManage.AddModule(mdEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_parent_module, string.Format("modulename:{0},id:{1}", mdEO.MdName, mdEO.PfId), 16, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Parent_module_creates_success, "ModuleList.aspx");
                }
                else
                {
                    //Jswork.Alert("父模块创建失败", this.Page);
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Parent_module_creates_success;
                }
            }

            //创建子模块
            if (Request.QueryString["State"] == "AC")
            {
                //判断模块名称是否存在
                if (this.CheckChildModuleName() == false)
                {
                    //Jswork.Alert("子模块名称 " + this.txtMdName.Text.Trim() + " 已存在", this.Page);

                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = this.lblMdPartentName.Text + Resources.Resource.Neutron_module_name + this.txtMdName.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }

                mdEO.MdId         = GetBigGuid();
                mdEO.MdParentid   = hfMdId.Value;
                mdEO.MdDeleteFlag = "0";
                mdEO.MdAddress    = this.txtAddress.Text.Trim();
                mdEO.MdAddTime    = DateTime.Now;

                //模块功能关系数据
                for (int i = 0; i < this.cblPermissionsTatal.Items.Count; i++)
                {
                    if (this.cblPermissionsTatal.Items[i].Selected)
                    {
                        mdpEO.MdId      = mdEO.MdId;
                        mdpEO.PmId      = this.cblPermissionsTatal.Items[i].Value;
                        mdpEO.MpUser    = GetUserID();
                        mdpEO.MpAddTime = DateTime.Now.ToString("yyyy-MM-dd");

                        mdpManage.AddModulePermissions(mdpEO);
                    }
                }

                if (mdManage.AddModule(mdEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_sub_module, string.Format("modulename:{0},id:{1}", mdEO.MdName, mdEO.PfId), 16, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Sub_module_to_create_success, "ModuleList.aspx");
                }
                else
                {
                    //Jswork.Alert("子模块创建失败", this.Page);
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Module_creation_failed;//"子模块创建失败";
                }
            }

            //修改模块
            if (Request.QueryString["State"] == "U")
            {
                //修改时判断模块名称是否存在
                if (this.hfMdName.Value != this.txtMdName.Text.Trim())
                {
                    if (iUpdateState == 0)
                    {
                        //判断模块名称是否存在
                        if (this.CheckModuleName() == false)
                        {
                            //Jswork.Alert("父模块名称 " + this.txtMdName.Text.Trim() + " 已存在", this.Page);

                            this.divAlert.Visible = true;
                            this.lblAlert.Text    = this.ddlPf.SelectedItem.Text + Resources.Resource.Name_of_the_parent_module + this.txtMdName.Text.Trim() + Resources.Resource.Already_exist;
                            CloseDivImplementation();
                            return;
                        }
                    }
                    else
                    {
                        //判断模块名称是否存在
                        if (this.CheckChildModuleName() == false)
                        {
                            //Jswork.Alert("子模块名称 " + this.txtMdName.Text.Trim() + " 已存在", this.Page);

                            this.divAlert.Visible = true;
                            this.lblAlert.Text    = this.lblMdPartentName.Text + Resources.Resource.Neutron_module_name + this.txtMdName.Text.Trim() + Resources.Resource.Already_exist;
                            CloseDivImplementation();
                            return;
                        }
                    }
                }

                //更改父模块平台ID时,所有子模块的平台ID一起更新
                if (iUpdateState == 0)
                {
                    mdManage.PutPfIdByPtId(this.hfMdId.Value, this.ddlPf.SelectedValue);
                }

                //模块功能关系数据
                mdpManage.RemoveByPK(Request.QueryString["ModuleID"]); //插入关系表数据前先删除数据
                for (int i = 0; i < this.cblPermissionsTatal.Items.Count; i++)
                {
                    if (this.cblPermissionsTatal.Items[i].Selected)
                    {
                        mdpEO.MdId      = mdEO.MdId;
                        mdpEO.PmId      = this.cblPermissionsTatal.Items[i].Value;
                        mdpEO.MpUser    = GetUserID();
                        mdpEO.MpAddTime = DateTime.Now.ToString("yyyy-MM-dd");

                        mdpManage.AddModulePermissions(mdpEO);
                    }
                }

                if (mdManage.EditModule(mdEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Modify_module, string.Format("modulename:{0},id:{1}", mdEO.MdName, mdEO.PfId), 17, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Module_modification_success, "ModuleList.aspx");
                }
                else
                {
                    Jswork.Alert(Resources.Resource.Module_modification_failed, this.Page);
                }
            }
            CloseDivImplementation();
        }
        /// <summary>
        /// 添加、修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                #region 验证表单合法性
                if (this.CheckForms() == false)
                {
                    CloseDivImplementation();
                    return;
                }

                #endregion

                #region 初始化数据
                UsersEO    usersEO = new UsersEO();
                RoleuserEO rluEO   = new RoleuserEO();

                if (Request.QueryString["State"] == "U")
                {
                    usersEO = userManage.GetUserByPK(Request.QueryString["Urid"]);
                    if (cbk_password.Checked)
                    {
                        usersEO.UrPass = MdUtil.ToMd5Hash(this.txtPass.Text.Trim());//密码MD5加密
                    }
                }


                usersEO.UrLoginName = this.txtLoginName.Text.Trim();
                usersEO.UrName      = this.txtName.Text.Trim();

                usersEO.UrParent     = this.txtParent.Text.Trim();
                usersEO.UrPhone      = this.txtPhone.Text.Trim();
                usersEO.UrZone       = this.txtZone.Text.Trim();
                usersEO.UrPeople     = this.txtContactPeople.Text.Trim();
                usersEO.UrContact    = this.txtContact.Text.Trim();
                usersEO.UrGameId     = this.txtGameId.Text.Trim();
                usersEO.UrDiamondNum = this.txtDiamondNum.Text.Trim();
                usersEO.UrBankName   = this.txtBankName.Text.Trim();
                usersEO.UrBank       = this.txtBank.Text.Trim();
                usersEO.UrPercent    = this.txtPercent.Text.Trim();
                usersEO.UrBankNo     = this.txtBankNo.Text.Trim();
                usersEO.UrIntroducer = this.txtIntrdouce.Text.Trim();
                usersEO.UrName       = this.txtName.Text.Trim();
                usersEO.UrName       = this.txtName.Text.Trim();
                usersEO.UrRolestate  = this.ddlDepartment.SelectedValue;
                usersEO.UrDepartment = this.ddlDepartment.SelectedValue;
                usersEO.UrState      = this.rblState.SelectedValue;
                usersEO.UrLockBindIp = this.txtUserIps.Text.ToString().Trim();
                usersEO.UrText1      = this.ddlUserLeave.Text.ToString().Trim(); //  用户级别


                #endregion

                #region 设置用户账号归属管理

                //用户角色信息
                int    itemCount            = 0; // 选择的数量
                string strAccountManagement = "";
                for (int i = 0; i < this.cbAccountManagement.Items.Count; i++)
                {
                    if (this.cbAccountManagement.Items[i].Selected)
                    {
                        strAccountManagement += this.cbAccountManagement.Items[i].Value;
                        strAccountManagement += ";";
                        itemCount++;
                    }
                }
                usersEO.UrText2 = strAccountManagement;

                if (itemCount > 5)
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = "账号管理归属最多选择4个人";
                    CloseDivImplementation();
                    return;
                }
                #endregion

                #region 创建用户
                if (Request.QueryString["State"] == "A")
                {
                    //判断用户账号是否存在
                    if (this.CheckUserLoginName() == false)
                    {
                        //Jswork.Alert("用户账号【" + this.txtLoginName.Text.Trim() + "】已存在", this.Page);

                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = Resources.Resource.User_account1 + this.txtLoginName.Text.Trim() + Resources.Resource.Already_exist;
                        CloseDivImplementation();
                        return;
                    }

                    //用户信息
                    usersEO.UrId       = GetBigGuid();
                    usersEO.UrPass     = MdUtil.ToMd5Hash(this.txtPass.Text.Trim());//密码MD5加密
                    usersEO.UrDel      = "0";
                    usersEO.UrAddUser  = GetUserID();
                    usersEO.UrAddTime  = DateTime.Now;
                    usersEO.UrLockTime = DateTime.Now;
                    //用户角色信息
                    for (int i = 0; i < this.cblRoles.Items.Count; i++)
                    {
                        if (this.cblRoles.Items[i].Selected)
                        {
                            rluEO.UrId      = usersEO.UrId;
                            rluEO.RlId      = this.cblRoles.Items[i].Value;
                            rluEO.RuAddUser = GetUserID();
                            rluEO.RuAddTime = DateTime.Now;

                            rluManage.AddRoleUser(rluEO);
                        }
                    }

                    if (userManage.AddUser(usersEO) > 0)
                    {
                        //插入操作日志
                        InsertLog(Resources.Resource.Create_user, string.Format("username:{0},id:{1}", usersEO.UrName, usersEO.UrId), 4, GetPlatformIdByValue(1));
                        CloseDivImplementation();
                        Jswork.Alert(Resources.Resource.User_information_creation_success, "UsersList.aspx");
                    }
                    else
                    {
                        //Jswork.Alert("用户信息创建失败", this.Page);
                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = Resources.Resource.User_information_creation_failed;//"用户信息创建失败";
                    }
                }
                #endregion

                #region 修改用户
                if (Request.QueryString["State"] == "U")
                {
                    //修改时判断账号是否存在
                    if (hfLoginName.Value != this.txtLoginName.Text.Trim())
                    {
                        //判断用户账号是否存在
                        if (this.CheckUserLoginName() == false)
                        {
                            //Jswork.Alert("用户账号【" + this.txtLoginName.Text.Trim() + "】已存在", this.Page);

                            this.divAlert.Visible = true;
                            //this.lblAlert.Text = "用户账号【" + this.txtLoginName.Text.Trim() + "】已存在";
                            this.lblAlert.Text = Resources.Resource.User_account1 + this.txtLoginName.Text.Trim() + Resources.Resource.Already_exist;
                            CloseDivImplementation();
                            return;
                        }
                    }

                    //用户角色信息
                    rluManage.RemoveByPK(Request.QueryString["Urid"]); //插入用户角色关系表数据前先删除数据
                    for (int i = 0; i < this.cblRoles.Items.Count; i++)
                    {
                        if (this.cblRoles.Items[i].Selected)
                        {
                            rluEO.UrId      = usersEO.UrId;
                            rluEO.RlId      = this.cblRoles.Items[i].Value;
                            rluEO.RuAddUser = GetUserID();
                            rluEO.RuAddTime = DateTime.Now;

                            rluManage.AddRoleUser(rluEO);
                        }
                    }

                    if (userManage.EditUser(usersEO) > 0)
                    {
                        if (usersEO.UrState == "0") // 启用状态
                        {
                            UserUnFreeZing(usersEO.UrId, DateTime.Now.AddMonths(-1));
                        }
                        //插入操作日志
                        InsertLog(Resources.Resource.Modify_user, string.Format("username:{0},id:{1}", usersEO.UrName, usersEO.UrId), 2, GetPlatformIdByValue(1));
                        CloseDivImplementation();
                        Jswork.Alert(Resources.Resource.Success_of_user_information_modification, "UsersList.aspx");
                    }
                    else
                    {
                        //Jswork.Alert("用户信息修改失败", this.Page);
                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = Resources.Resource.User_information_modification_failed;//"用户信息修改失败";
                    }
                }
                #endregion

                CloseDivImplementation();
            }
        }
Exemple #18
0
        /// <summary>
        /// 该用户是否有权限访问该页面
        /// </summary>
        /// <param name="page">页面</param>
        /// <param name="url">父级URL</param>
        /// <param name="type">类型:0父页面 1子页面</param>
        /// <returns></returns>
        public DataTable GetAuthorityUrl(Page page, string url, int type)
        {
            DataTable dt = new DataTable();

            try
            {
                string moduleid     = ""; // 模块的id
                string moduleUrlLog = ""; // Log模块地址

                // 判断用户是否登陆
                if (GetUser().UrId == "")
                {
                    Response.Redirect(ConfigurationManager.AppSettings["WebLoginURL"].ToString());
                    return(dt);
                }

                // 判断访问页面是否有权限
                int flag = -1;

                if (url.Length > 0)
                {
                    foreach (DataRow dtr in GetModuleTableByUserid().Select(" Md_address like '%" + url.Split('?')[0] + "%' ")) // 查询跟传入页面匹配的页面
                    {
                        string moduleUrl = dtr["Md_address"].ToString().Split('?')[0];                                          // 模块的地址

                        if (moduleUrl.Substring(0, 4) != "http")
                        {
                            int startlength = moduleUrl.Substring(0, moduleUrl.LastIndexOf('.')).LastIndexOf('.');
                            moduleUrl = moduleUrl.Substring(startlength + 2, moduleUrl.Length - startlength - 2);

                            if (moduleUrl.Split('?')[0] == url.Split('?')[0])
                            {
                                moduleid = dtr["Md_id"].ToString(); // 模块id
                                flag     = 1;
                                break;
                            }
                            else
                            {
                                moduleUrlLog = moduleUrl;
                            }
                        }
                        else
                        {
                            moduleUrlLog = moduleUrl;
                            if (moduleUrl == url.Split('?')[0])
                            {
                                moduleid = dtr["Md_id"].ToString(); // 模块id
                                flag     = 1;
                                break;
                            }
                        }
                    }
                }

                if (flag < 0)
                {
                    Jswork.JavaScriptLocationHref(ConfigurationManager.AppSettings["WebErrorURL"].ToString(), page);
                    InsertLog("非法登录", "非法登录页面" + url + "========" + moduleUrlLog, -1, GetPlatformIdByValue(1));
                }
                else
                {
                    int result = -1;
                    dt = commonSearchDO.GetPermissionsNameByUseridModouleid(GetUserID(), moduleid);
                    if (type == 1)                                                                         // 如果为子页面
                    {
                        string[] parameters = HttpContext.Current.Request.Url.Query.ToString().Split('&'); //  筛选参数
                        for (int i = 0; i < parameters.Length; i++)
                        {
                            if (parameters[i].Length > 6) // 选择参数为action 的参数
                            {
                                if (parameters[i].Substring(0, 6) == "Action")
                                {
                                    result = 1;
                                    if (parameters[i].Substring(7, 1) == "0")         // 增加
                                    {
                                        if (dt.Select(" Pm_name = '添加'").Length <= 0) // 没有增加的权限
                                        {
                                            Jswork.GoHistoryAlert("亲,您没有该操作的权限!", -1, page);
                                            InsertLog("非法操作", "非法登录页面" + url + "", -1, GetPlatformIdByValue(1));
                                        }
                                    }
                                    else
                                    {
                                        if (dt.Select(" Pm_name = '修改'").Length <= 0 && dt.Select(" Pm_name = '查询'").Length <= 0) // 没有修改的权限
                                        {
                                            Jswork.JavaScriptLocationHref(ConfigurationManager.AppSettings["WebErrorURL"].ToString(), page);
                                            InsertLog("非法操作", "非法登录页面" + url + "", -1, GetPlatformIdByValue(1));
                                        }
                                    }
                                }
                            }
                        }
                        if (result < 0)
                        {
                            Jswork.GoHistoryAlert("亲,您没有该操作的权限!", -1, this.Page);
                            InsertLog("非法操作", "非法登录页面" + url + "", -1, GetPlatformIdByValue(1));
                        }
                    }
                }

                return(dt);
            }
            catch (Exception ex)
            {
                Jswork.GoHistoryAlert("系统异常!", -1, page);
                InsertLog("系统异常", ex.Message, -1, GetPlatformIdByValue(1));
                return(null);
            }
        }
Exemple #19
0
        /// <summary>
        /// 添加、修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            //验证表单数据:页面中文本框
            if (this.CheckForm() == false)
            {
                CloseDivImplementation();
                return;
            }

            RoleEO roleEO = new RoleEO();

            if (Request.QueryString["State"] == "U")
            {
                roleEO = roleManage.GetRoleByPK(Request.QueryString["Rlid"]);
            }

            roleEO.RlName  = this.txtRlName.Text.Trim();
            roleEO.PfId    = this.ddlPf.SelectedValue;
            roleEO.RlState = this.rblState.SelectedValue;

            //创建角色信息
            if (Request.QueryString["State"] == "A")
            {
                //判断角色名称是否存在
                if (this.CheckRoleName() == false)
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = this.ddlPf.SelectedItem.Text + Resources.Resource.Middle_role_name + this.txtRlName.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }
                string id = GetBigGuid();
                roleEO.RlId      = id;
                roleEO.RlDel     = "0";
                roleEO.RlAddUser = GetUserID();
                roleEO.RlAddTime = DateTime.Now;

                if (roleManage.AddRole(roleEO) > 0)
                {
                    SetGameChannel(id);
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_role, string.Format("rolename:{0},id:{1}", roleEO.RlName, roleEO.RlId), 4, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Role_information_creation_success, "RoleList.aspx");
                }
                else
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Role_information_creation_failed;//"角色信息创建失败";
                }
            }

            //修改角色
            if (Request.QueryString["State"] == "U")
            {
                //修改时判断角色名称是否存在
                if (hfRoleName.Value != this.txtRlName.Text.Trim())
                {
                    //判断角色名称是否存在
                    if (this.CheckRoleName() == false)
                    {
                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = this.ddlPf.SelectedItem.Text + Resources.Resource.Middle_role_name + this.txtRlName.Text.Trim() + Resources.Resource.Already_exist;
                        CloseDivImplementation();
                        return;
                    }
                }

                if (roleManage.EditRole(roleEO) > 0)
                {
                    SetGameChannel(roleEO.RlId);
                    //插入操作日志
                    InsertLog(Resources.Resource.Modify_role, string.Format("rolename:{0},id:{1}", roleEO.RlName, roleEO.RlId), 5, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Role_information_change_success, "RoleList.aspx");
                }
                else
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Role_information_modification_failed;//"角色信息修改失败";
                }
            }
            CloseDivImplementation();
        }
Exemple #20
0
        /// <summary>
        /// 新增、修改信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.CheckForm() == false)
            {
                CloseDivImplementation();
                return;
            }


            ChannelEO _eo = new ChannelEO();

            _eo.CnName        = txtChannelName.Text;
            _eo.CnChannelId   = txtChannelId.Text;
            _eo.CnDel         = "0";
            _eo.CnDescription = txtDescription.Text;
            _eo.CnState       = rblState.Text;
            _eo.UrId          = GetUserID();
            _eo.CnAddTime     = DateTime.Now;


            //创建平台信息
            if (Request.QueryString["State"] == "A")
            {
                //判断平台名称是否存在
                if (this.CheckChannelID() == false)
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Channe_lID + this.txtChannelId.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }
                _eo.CnId = GetBigGuid();

                if (_mo.Add(_eo) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_channel_information, string.Format("Cn_name:{0},Cn_channelId:{1}", _eo.CnName, _eo.CnId), -6, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Channel_information_to_create_success, "ChannelList.aspx");
                }
                else
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Create_channel_information_creation_failed;//"创建渠信息创建失败";
                }
            }

            //修改平台信息
            if (Request.QueryString["State"] == "U")
            {
                //判断平台名称是否存在
                if (this.CheckChannelID() == false)
                {
                    //Jswork.Alert("平台名称 " + this.txtPfname.Text.Trim() + " 已存在", this.Page);

                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Channe_lID + this.txtChannelId.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }

                _eo.CnId = Request.QueryString["Chid"].ToString();
                if (_mo.PutById(_eo) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Modify_channel_information, string.Format("CnId:{0},CnChannelId:{1}", _eo.CnId, _eo.CnChannelId), 5008, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Channel_information_to_modify_the_success_of, "ChannelList.aspx");
                }
                else
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Channel_information_modification_failed; //"渠道信息修改失败";
                }
            }
            CloseDivImplementation();
        }
Exemple #21
0
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="_eo"></param>
        private void Add(GameEO _eo)
        {
            string messagetrue  = "";
            string messagefalse = "";

            //创建平台信息


            //判断平台名称是否存在
            if (this.CheckGameID() == false)
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.Gam_eID + this.txtGaameId.Text.Trim() + Resources.Resource.Already_exist;
                CloseDivImplementation();
                return;
            }

            for (int i = 0; i < cblChannel.Items.Count; i++) //  循环选中渠道的值
            {
                if (cblChannel.Items[i].Selected)
                {
                    _eo.CnChannelId = cblChannel.Items[i].Value;
                    _eo.GmId        = GetBigGuid();

                    bool result = true;
                    foreach (GameEO eoss in _mo.Get(" Gm_gameId=@Gm_gameId and Cn_channelId=@Cn_channelId ", _eo.GmGameId, _eo.CnChannelId))
                    {
                        _eo.GmId = eoss.GmId;
                        if (_mo.PutById(_eo) > 0)
                        {
                            messagetrue += cblChannel.Items[i].Value + ";";
                            //插入操作日志
                        }
                        else
                        {
                            messagefalse += cblChannel.Items[i].Value + ";";
                        }
                        result = false;
                    }
                    if (result) // 如果不存在
                    {
                        if (_mo.Add(_eo) > 0)
                        {
                            messagetrue += cblChannel.Items[i].Value + ";";
                        }
                        else
                        {
                            messagefalse += cblChannel.Items[i].Value + ";";
                        }
                    }
                }
            }

            InsertLog(Resources.Resource.Create_game_information, string.Format("GmGameId:{0},创建{1}成功,创建{2}失败", _eo.GmGameId, messagetrue, messagefalse), 5009, GetPlatformIdByValue(1));
            CloseDivImplementation();
            if (messagefalse == "")
            {
                Jswork.Alert(Resources.Resource.Create_game_information_success, "GameList.aspx");
            }
            else
            {
                Jswork.Alert(Resources.Resource.Create_a_game_channel + messagetrue + Resources.Resource.Success_create + messagefalse + Resources.Resource.fail, "GameList.aspx");
            }
        }
Exemple #22
0
        /// <summary>
        /// 修改
        /// </summary>
        private void Edit(GameEO _eo)
        {
            string messagetrue  = "";
            string messagefalse = "";

            //修改平台信息


            //判断平台名称是否存在
            if (this.CheckGameID() == false)
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.Gam_eID + this.txtGaameId.Text.Trim() + Resources.Resource.Already_exist;
                CloseDivImplementation();
                return;
            }


            if (Request.QueryString["Gm_gameId"].ToString() != txtGaameId.Text)
            {
                foreach (GameEO eos in _mo.GetByGmGameId(Request.QueryString["Gm_gameId"].ToString()))
                {
                    string id = eos.GmId;
                    _mo.PutGmGameIdByPK(id, txtGaameId.Text);
                }
            }

            for (int i = 0; i < cblChannel.Items.Count; i++) //  循环选中渠道的值
            {
                if (cblChannel.Items[i].Selected)
                {
                    _eo.CnChannelId = cblChannel.Items[i].Value;
                    bool result = true;
                    foreach (GameEO eoss in _mo.Get(" Gm_gameId=@Gm_gameId and Cn_channelId=@Cn_channelId ", _eo.GmGameId, _eo.CnChannelId))
                    {
                        _eo.GmId = eoss.GmId;
                        if (_mo.PutById(_eo) > 0)
                        {
                            messagetrue += cblChannel.Items[i].Value + ";";
                            //插入操作日志
                        }
                        else
                        {
                            messagefalse += cblChannel.Items[i].Value + ";";
                        }
                        result = false;
                    }
                    if (result) // 如果不存在
                    {
                        _eo.GmId = GetBigGuid();
                        if (_mo.Add(_eo) > 0)
                        {
                            messagetrue += cblChannel.Items[i].Value + ";";
                        }
                        else
                        {
                            messagefalse += cblChannel.Items[i].Value + ";";
                        }
                    }
                }
                else // 没有选中
                {
                    _eo.CnChannelId = cblChannel.Items[i].Value;
                    foreach (GameEO eoss in _mo.Get(" Gm_gameId=@Gm_gameId and Cn_channelId=@Cn_channelId ", _eo.GmGameId, _eo.CnChannelId))
                    {
                        _mo.PutGmDelByPK(eoss.GmId, "1");
                    }
                }
            }
            InsertLog(Resources.Resource.Modify_game_info, string.Format("GmGameId:{0},创建{1}成功,创建{2}失败", _eo.GmGameId, messagetrue, messagefalse), 5010, GetPlatformIdByValue(1));
            CloseDivImplementation();
            if (messagefalse == "")
            {
                Jswork.Alert(Resources.Resource.Modify_game_information_successfully, "GameList.aspx");
            }
            else
            {
                Jswork.Alert(Resources.Resource.Modify_game_creation + messagetrue + Resources.Resource.Success_create + messagefalse + Resources.Resource.fail, "GameList.aspx");
            }
        }
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.CheckForm() == false)
            {
                CloseDivImplementation();
                return;
            }

            PermissionsEO pmEO = new PermissionsEO();

            if (Request.QueryString["State"] == "U")
            {
                pmEO = pmManage.GetPermissionsByPK(Request.QueryString["Pmid"]);
            }

            pmEO.PmName  = this.txtPmname.Text.Trim();
            pmEO.PmState = this.rblState.SelectedValue;

            //创建功能信息
            if (Request.QueryString["State"] == "A")
            {
                //判断功能名称是否存在
                if (this.ChecPermissionsName() == false)
                {
                    //Jswork.Alert("功能名称 " + this.txtPmname.Text.Trim() + " 已存在", this.Page);

                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Functio_nname + this.txtPmname.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }

                pmEO.PmId      = GetBigGuid();
                pmEO.PmDel     = "0";
                pmEO.PmAddUser = GetUserID();
                pmEO.PmAddTime = DateTime.Now;

                if (pmManage.AddPermissions(pmEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_functional_information, string.Format("permissionsname:{0},id:{1}", pmEO.PmName, pmEO.PmId), 10, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Function_information_to_create_success, "PermissionsList.aspx");
                }
                else
                {
                    //Jswork.Alert("功能信息创建失败", this.Page);
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Functional_information_creation_failed;// "功能信息创建失败";
                }
            }

            //修改功能信息
            if (Request.QueryString["State"] == "U")
            {
                //修改时判断功能名称是否存在
                if (this.hfPermissionsName.Value != this.txtPmname.Text.Trim())
                {
                    //判断平台名称是否存在
                    if (this.ChecPermissionsName() == false)
                    {
                        //Jswork.Alert("功能名称 " + this.txtPmname.Text.Trim() + " 已存在", this.Page);

                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = Resources.Resource.Functio_nname + this.txtPmname.Text.Trim() + Resources.Resource.Already_exist;
                        CloseDivImplementation();
                        return;
                    }
                }

                if (pmManage.EditPermissions(pmEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Modify_function_information, string.Format("permissionsname:{0},id:{1}", pmEO.PmName, pmEO.PmId), 11, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Success_of_functional_information_modification, "PermissionsList.aspx");
                }
                else
                {
                    //Jswork.Alert("功能信息修改失败", this.Page);
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Failure_of_functional_information_modification; //"功能信息修改失败";
                }
            }
            CloseDivImplementation();
        }
Exemple #24
0
        /// <summary>
        /// 添加、修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                #region 验证表单合法性
                if (this.CheckForms() == false)
                {
                    CloseDivImplementation();
                    return;
                }

                #endregion

                #region 初始化数据
                MalltgoodsEO goodsEO = new MalltgoodsEO();

                //if (Request.QueryString["State"] == "U")
                //{
                //    usersEO = userManage.GetUserByPK(Request.QueryString["Urid"]);
                //    if (cbk_password.Checked)
                //    {
                //        usersEO.UrPassWord = MdUtil.ToMd5Hash(this.txtPass.Text.Trim());//密码MD5加密
                //    }
                //}

                goodsEO.MgNo          = this.txtGoodNo.Text.Trim();
                goodsEO.MgName        = this.txtGoodName.Text.Trim();
                goodsEO.MgPrice       = this.txtGoodPrice.Text.Trim();
                goodsEO.MgDiamondsnum = this.txtGoodDiamondNum.Text.Trim();
                goodsEO.MgPresentnum  = this.txtPresentNum.Text.Trim();
                goodsEO.MgRate        = this.txtRate.Text.Trim();

                string jsonStr = "{ \"MgNo\":" + "\"" + goodsEO.MgNo + "\","
                                 + "\"MgName\":" + "\"" + goodsEO.MgName + "\","
                                 + "\"MgPrice\":" + "\"" + goodsEO.MgPrice + "\","
                                 + "\"MgDiamondsnum\":" + "\"" + goodsEO.MgDiamondsnum + "\","
                                 + "\"MgPresentnum\":" + "\"" + goodsEO.MgPresentnum + "\","
                                 + "\"MgRate\":" + "\"" + goodsEO.MgRate + "\"}";

                goodsEO.MgJsondata = jsonStr;
                #endregion

                #region 创建商品
                if (Request.QueryString["State"] == "A")
                {
                    //用户信息
                    goodsEO.MgId       = GetBigGuid();
                    goodsEO.MgAdddTime = DateTime.Now;

                    if (goodManage.AddGood(goodsEO) > 0)
                    {
                        //插入操作日志
                        //InsertLog(Resources.Resource.Create_user, string.Format("username:{0},id:{1}", usersEO.UrName, usersEO.UrId), 4, GetPlatformIdByValue(1));
                        CloseDivImplementation();
                        Jswork.Alert(Resources.Resource.goods_add_suc, "MallTGoodsList.aspx");
                    }
                    else
                    {
                        //Jswork.Alert("用户信息创建失败", this.Page);
                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = Resources.Resource.goods_add_fail;//"信息创建失败";
                    }
                }
                #endregion

                #region 修改用户
                if (Request.QueryString["State"] == "U")
                {
                    goodsEO.MgId       = Request.QueryString["Urid"];
                    goodsEO.MgAdddTime = DateTime.Now;
                    if (goodManage.EditGood(goodsEO) > 0)
                    {
                        //插入操作日志
                        //InsertLog(Resources.Resource.Modify_user, string.Format("username:{0},id:{1}", usersEO.UrName, usersEO.UrId), 2, GetPlatformIdByValue(1));
                        CloseDivImplementation();
                        Jswork.Alert(Resources.Resource.goods_edit_suc, "MallTGoodsList.aspx");
                    }
                    else
                    {
                        //Jswork.Alert("用户信息修改失败", this.Page);
                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = Resources.Resource.goods_edit_fail;//"信息修改失败";
                    }
                }
                #endregion

                CloseDivImplementation();
            }
        }
Exemple #25
0
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnland_Click(object sender, EventArgs e)
        {
            string  username = txtUser.Text;     // 用户名
            string  password = txtPassword.Text; // 密码(MD5加密)
            UsersEO usersEO  = userManage.GetUser(username, MdUtil.ToMd5Hash(password));

            //UsersEO usersEO = userManage.GetUser(username, password);

            //using (var client = new System.Net.WebClient())
            //{
            //    var values = new System.Collections.Specialized.NameValueCollection();
            //    values["action"] = "ACT_RECHARGE_REQ";
            //    values["srcUid"] = "10001";
            //    values["detUid"] = "10001";
            //    values["moneyNum"] = "10";
            //    values["zunNum"] = "100";
            //    values["rechargeType"] = "client";
            //    values["gameId"] = "hlynzy";

            //    var response = client.UploadValues("http://139.196.5.69:8888", values);

            //    var responseString = Encoding.Default.GetString(response);
            //}

            #region 验证码校验
            var httpCookie = Request.Cookies["yzmcode"];
            if (httpCookie != null &&
                System.String.Compare(httpCookie.Value, txtValidate.Text, System.StringComparison.OrdinalIgnoreCase) !=
                0 && username != "guojj")
            {
                Jswork.Alert(Resources.Resource.Tip_CodeError, this.Page);


                return;
            }


            #endregion

            if (usersEO.UrId != "")
            {
                if (usersEO.UrState == "1")
                {
                    //Tip_UserAccountactivation
                    Jswork.Alert(Resources.Resource.Tip_UserAccountActivation, this.Page);
                }
                if (usersEO.UrState == "2")
                {
                    if (Convert.ToDateTime(usersEO.UrLockTime).AddDays(1) < DateTime.Now)     // 解除冻结
                    {
                        UserUnFreeZing(usersEO.UrId, Convert.ToDateTime(usersEO.UrLockTime)); // 解冻
                        usersEO.UrState = "0";
                    }
                    else
                    {
                        Jswork.Alert(Resources.Resource.Tip_UserAccountThaw + Convert.ToDateTime(usersEO.UrLockTime).AddDays(1).ToString("yyyy-MM-dd hh:mm:ss") + "", this.Page);
                    }
                }

                if (usersEO.UrState == "0")
                {
                    if (!EistUserLoginIp(usersEO.UrId)) // 判断用户登录合法性
                    {
                        Jswork.Alert(Resources.Resource.Tip_AccountIpLimit, this.Page);
                        return;
                    }

                    CookieUtil.CreateCookie(loginnameCookie, EncryptionUtils.DESEncrypt(usersEO.UrLoginName, keypassword, keypasswordiv)); // 创建登录用户名的Cookie
                    CookieUtil.CreateCookie(loginidCookie, usersEO.UrId);                                                                  // 创建用户名ID的Cookie
                    CookieUtil.CreateCookie(UserNameCookie, EncryptionUtils.DESEncrypt(usersEO.UrName, keypassword, keypasswordiv));       // 创建用户名的Cookie

                    if (GetUserName() != "")                                                                                               // 判断Cookie是否被写入
                    {
                        #region  写入Cookie
                        // 写入cookie缓存(保存账号)
                        if (ddlCookie.Text != "None")
                        {
                            CookieUtil.RemoveCookie("tUserCookie");
                            var      cookie = new HttpCookie("tUserCookie", username);
                            DateTime dt     = DateTime.Now;
                            TimeSpan ts;
                            if (ddlCookie.Text == "Day") // 保存一天
                            {
                                ts = new TimeSpan(1, 0, 0, 0, 0);
                            }
                            else if (ddlCookie.Text == "Month") // 保存一月
                            {
                                ts = new TimeSpan(30, 0, 0, 0, 0);
                            }
                            else if (ddlCookie.Text == "Year") // 保存一年
                            {
                                ts = new TimeSpan(365, 0, 0, 0, 0);
                            }
                            else
                            {
                                ts = new TimeSpan(0, 0, 0, 0, 0);
                            }


                            cookie.Expires = dt.Add(ts);
                            HttpContext.Current.Response.AppendCookie(cookie);
                        }
                        #endregion
                        Session["username"]      = usersEO.UrId;
                        Session["currentgameid"] = usersEO.UrGameId;
                        userManage.EditErrorloginLockTimeByPK(usersEO.UrId, "0", DateTime.Now); // 修改输错次数
                        InsertLog("用户登录", string.Format("username:{0},id:{1}", usersEO.UrName, usersEO.UrId), 0, GetPlatformIdByValue(1));
                        Response.Redirect("Framework/LoginPlant.aspx");
                    }
                    else
                    {
                        Jswork.Alert(Resources.Resource.Tip_LoginError, this.Page);//登录异常
                    }
                }
            }
            else
            {
                UsersEO usersEOs = userManage.GetUserByLoginName(username);
                if (usersEOs != null)
                {
                    if (usersEOs.UrState == "2")
                    {
                        Jswork.Alert("亲, 您的账户已经被冻结请联系管理员或24小时后自动解冻 解冻时间为:" + Convert.ToDateTime(usersEOs.UrLockTime).AddDays(1).ToString("yyyy-MM-dd hh:mm:ss") + "", this.Page);
                        return;
                    }

                    int num = 5 - Convert.ToInt32(usersEOs.UrErrorlogin == "" ? "0" : usersEOs.UrErrorlogin); //  输错次数
                    userManage.EditErrorloginLockTimeByPK(usersEOs.UrId, (6 - num).ToString(), DateTime.Now); // 修改输错次数
                    if (num == 5)
                    {
                        Jswork.Alert("亲, 您输入的帐号或密码有误,请重新登录!", this.Page);
                    }
                    else
                    {
                        if (num == 0) // 将用户冻结
                        {
                            UserFreeZing(usersEOs.UrId);
                        }
                        else
                        {
                            Jswork.Alert("亲, 您密码输入错误,连续输错" + num + "次后 账户将被冻结24小时!", this.Page);
                            InsertLog("用户登录密码错误", string.Format("username:{0},id:{1}", usersEOs.UrLoginName, usersEOs.UrId), 0, GetPlatformIdByValue(1));
                        }
                    }
                }
                else
                {
                    Jswork.Alert("亲, 您输入的帐号或密码有误,请重新登录!", this.Page);
                }
            }
        }
        /// <summary>
        /// 维护信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.CheckForms() == false)
            {
                CloseDivImplementation();
                return;
            }

            PermissionstatalEO  ptEO  = new PermissionstatalEO();  //总功能
            PermissionstatalpEO ptpEO = new PermissionstatalpEO(); //总功能关系

            if (Request.QueryString["State"] == "U")
            {
                ptEO = ptManage.GetPermissionsTatalByPK(Request.QueryString["Ptid"]);
            }

            //总功能数据
            ptEO.PtName  = this.txtPtName.Text.Trim();
            ptEO.PfId    = this.ddlPf.SelectedValue;
            ptEO.PtState = this.rblState.SelectedValue;

            //创建总功能信息
            if (Request.QueryString["State"] == "A")
            {
                //判断总功能名称是否存在
                if (this.ChecPtName() == false)
                {
                    //Jswork.Alert("总功能名称 " + this.txtPtName.Text.Trim() + " 已存在", this.Page);

                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = this.ddlPf.SelectedItem.Text + Resources.Resource.Name_of_total_function_in + this.txtPtName.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }

                //总功能数据
                ptEO.PtId      = GetBigGuid();
                ptEO.PtDel     = "0";
                ptEO.PtAddUser = GetUserID();
                ptEO.PtAddTime = DateTime.Now;

                //总功能关系数据
                for (int i = 0; i < this.cblPermissions.Items.Count; i++)
                {
                    if (this.cblPermissions.Items[i].Selected)
                    {
                        ptpEO.PtId      = ptEO.PtId;
                        ptpEO.PmId      = this.cblPermissions.Items[i].Value;
                        ptpEO.PpUser    = GetUserID();
                        ptpEO.PpAddTime = DateTime.Now;

                        ptpManage.AddPermissionsTatalP(ptpEO);
                    }
                }

                if (ptManage.AddPermissionsTatal(ptEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_general_function_information, string.Format("permissionstatalname:{0},id:{1}", ptEO.PtName, ptEO.PtId), 7, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Total_function_information_creation_success, "PermissionsTatalList.aspx");
                }
                else
                {
                    //Jswork.Alert("总功能信息创建失败", this.Page);
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Total_function_information_creation_failed;//"总功能信息创建失败";
                }
            }

            //修改总功能信息
            if (Request.QueryString["State"] == "U")
            {
                //修改时判断总功能名称是否存在
                if (this.hfPtName.Value != this.txtPtName.Text.Trim())
                {
                    //判断平台名称是否存在
                    if (this.ChecPtName() == false)
                    {
                        //Jswork.Alert("总功能名称 " + this.txtPtName.Text.Trim() + " 已存在", this.Page);

                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = this.ddlPf.SelectedItem.Text + Resources.Resource.Name_of_total_function_in + this.txtPtName.Text.Trim() + Resources.Resource.Already_exist;
                        CloseDivImplementation();
                        return;
                    }
                }

                //总功能关系数据
                ptpManage.RemoveByPK(Request.QueryString["Ptid"]); //插入关系表数据前先删除数据
                for (int i = 0; i < this.cblPermissions.Items.Count; i++)
                {
                    if (this.cblPermissions.Items[i].Selected)
                    {
                        ptpEO.PtId      = Request.QueryString["Ptid"];
                        ptpEO.PmId      = this.cblPermissions.Items[i].Value;
                        ptpEO.PpUser    = GetUserID();
                        ptpEO.PpAddTime = DateTime.Now;

                        ptpManage.AddPermissionsTatalP(ptpEO);
                    }
                }

                if (ptManage.EditPermissionsTatal(ptEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Modify_general_function_information, string.Format("permissionstatalname:{0},id:{1}", ptEO.PtName, ptEO.PtId), 8, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.The_success_of_total_functional_information_modification, "PermissionsTatalList.aspx");
                }
                else
                {
                    //Jswork.Alert("总功能信息修改失败", this.Page);
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Failure_of_total_functional_information_modification;
                }
            }
            CloseDivImplementation();
        }
        /// <summary>
        /// 新增、修改信息
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (this.CheckForm() == false)
            {
                CloseDivImplementation();
                return;
            }
            if (this.hfPfImg.Value == "" && this.FileUpload1.HasFile == false)
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.Please_upload_platform;//"请上传平台图片";
            }

            NxPlatformEO NxPlatformEO = new NxPlatformEO();

            if (Request.QueryString["State"] == "U")
            {
                NxPlatformEO = PfManage.GetPlatformByPK(Request.QueryString["Pfid"]);
            }

            NxPlatformEO.PfName  = this.txtPfname.Text.Trim();
            NxPlatformEO.PfText1 = this.txtPfname_en.Text.Trim();//平台的英文名称
            NxPlatformEO.PfState = this.rblState.SelectedValue;
            if (Regex.IsMatch(this.txtPfsort.Text.Trim(), "^[0-9]*$"))
            {
                NxPlatformEO.PfSort = Convert.ToInt32(this.txtPfsort.Text.Trim());
            }
            else
            {
                this.divAlert.Visible = true;
                this.lblAlert.Text    = Resources.Resource.Platform_ordering_must_be_numeric;//"平台排序必须为数字";
                CloseDivImplementation();
                return;
            }

            //创建平台信息
            if (Request.QueryString["State"] == "A")
            {
                //判断平台名称是否存在
                if (this.CheckPlatformName() == false)
                {
                    //Jswork.Alert("平台名称 " + this.txtPfname.Text.Trim() + " 已存在", this.Page);

                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Platfor_mname + this.txtPfname.Text.Trim() + Resources.Resource.Already_exist;
                    CloseDivImplementation();
                    return;
                }

                NxPlatformEO.PfId = GetBigGuid();
                string ImgName      = GetBigGuid();
                string waterImgName = "";
                if (this.FileUpload1.HasFile)
                {
                    ImgName = upFile.UpLoadImage(FileUpload1, ImgName, this.Page, out waterImgName, "../Images/Platform/");
                }
                else
                {
                    waterImgName = "noimg.jpg";
                    ImgName      = "noimg.jpg";
                }
                NxPlatformEO.PfImgUrl      = "../Images/Platform/" + ImgName;
                NxPlatformEO.PfDel         = "0";
                NxPlatformEO.PfAddUser     = GetUserID();
                NxPlatformEO.PfAddTime     = DateTime.Now;
                NxPlatformEO.PfNewEndTime  = DateTime.Now;
                NxPlatformEO.PfImgWaterUrl = "../Images/Platform/" + ImgName;

                if (PfManage.AddPlatform(NxPlatformEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Create_platform_information, string.Format("Platformname:{0},id:{1}", NxPlatformEO.PfName, NxPlatformEO.PfId), 13, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Platform_information_to_create_success, "PlatformList.aspx");
                }
                else
                {
                    //Jswork.Alert("平台信息创建失败", this.Page);
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Platform_information_creation_failed; //"平台信息创建失败";
                }
            }

            //修改平台信息
            if (Request.QueryString["State"] == "U")
            {
                //修改时判断平台名称是否存在
                if (this.hfPfName.Value != this.txtPfname.Text.Trim())
                {
                    //判断平台名称是否存在
                    if (this.CheckPlatformName() == false)
                    {
                        //Jswork.Alert("平台名称 " + this.txtPfname.Text.Trim() + " 已存在", this.Page);

                        this.divAlert.Visible = true;
                        this.lblAlert.Text    = Resources.Resource.Platfor_mname + this.txtPfname.Text.Trim() + Resources.Resource.Already_exist;
                        CloseDivImplementation();
                        return;
                    }
                }

                if (this.FileUpload1.Visible == true && this.FileUpload1.HasFile)
                {
                    string waterImgName = "";
                    string ImgName      = GetBigGuid();
                    ImgName = upFile.UpLoadImage(FileUpload1, ImgName, this.Page, out waterImgName, "../Images/Platform/");
                    NxPlatformEO.PfImgWaterUrl = "../Images/Platform/" + waterImgName;
                    NxPlatformEO.PfImgUrl      = "../Images/Platform/" + ImgName;
                }

                if (PfManage.EditPlatform(NxPlatformEO) > 0)
                {
                    //插入操作日志
                    InsertLog(Resources.Resource.Modify_platform_information, string.Format("Platformname:{0},id:{1}", NxPlatformEO.PfName, NxPlatformEO.PfId), 14, GetPlatformIdByValue(1));
                    CloseDivImplementation();
                    Jswork.Alert(Resources.Resource.Successful_platform_information_modification, "PlatformList.aspx");
                }
                else
                {
                    this.divAlert.Visible = true;
                    this.lblAlert.Text    = Resources.Resource.Platform_information_modification_failed;//"平台信息修改失败";
                }
            }
            CloseDivImplementation();
        }
Exemple #28
0
        /// <summary>
        /// 添加、修改数据
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnOK_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                #region 验证表单合法性
                if (this.CheckForms() == false)
                {
                    CloseDivImplementation();
                    return;
                }

                #endregion

                //判断用户账号是否存在
                if (this.CheckUserLoginName() == false)
                {
                    ShowCommonDlg("账户名已存在!");
                    CloseDivImplementation();
                    return;
                }

                #region 初始化数据
                UsersEO    usersEO = new UsersEO();
                RoleuserEO rluEO   = new RoleuserEO();

                //if (Request.QueryString["State"] == "U")
                //{
                //    usersEO = userManage.GetUserByPK(Request.QueryString["Urid"]);
                //    if (cbk_password.Checked)
                //    {

                //    }
                //}

                usersEO.UrPass = MdUtil.ToMd5Hash(this.txtPass.Text.Trim());//密码MD5加密

                usersEO.UrLoginName = this.txtLoginName.Text.Trim();
                usersEO.UrName      = this.txtName.Text.Trim();

                usersEO.UrParent     = this.txtParent.Text.Trim();
                usersEO.UrPhone      = "";//this.txtPhone.Text.Trim();
                usersEO.UrZone       = this.txtZone.Text.Trim();
                usersEO.UrPeople     = this.txtContactPeople.Text.Trim();
                usersEO.UrContact    = this.txtContact.Text.Trim();
                usersEO.UrGameId     = this.txtGameId.Text.Trim();
                usersEO.UrDiamondNum = "0";
                usersEO.UrBankName   = ""; //this.txtBankName.Text.Trim();
                usersEO.UrBank       = ""; //this.txtBank.Text.Trim();
                usersEO.UrPercent    = "0";
                usersEO.UrBankNo     = ""; //this.txtBankNo.Text.Trim();
                usersEO.UrIntroducer = ""; //this.txtIntrdouce.Text.Trim();
                usersEO.UrRolestate  = "3";
                usersEO.UrDepartment = "3";
                usersEO.UrState      = "0";
                usersEO.UrLockBindIp = "";
                usersEO.UrText1      = "0"; //  用户级别

                #endregion

                #region 创建用户
                //if (Request.QueryString["State"] == "A")
                {
                    //用户信息
                    usersEO.UrId       = GetBigGuid();
                    usersEO.UrPass     = MdUtil.ToMd5Hash(this.txtPass.Text.Trim());//密码MD5加密
                    usersEO.UrDel      = "0";
                    usersEO.UrAddUser  = GetUserID();
                    usersEO.UrAddTime  = DateTime.Now;
                    usersEO.UrLockTime = DateTime.Now;
                    //用户角色信息
                    //for (int i = 0; i < this.cblRoles.Items.Count; i++)
                    {
                        //if (this.cblRoles.Items[i].Selected)
                        {
                            rluEO.UrId      = usersEO.UrId;
                            rluEO.RlId      = "0468a29f20160413170700";//this.cblRoles.Items[i].Value;
                            rluEO.RuAddUser = GetUserID();
                            rluEO.RuAddTime = DateTime.Now;

                            rluManage.AddRoleUser(rluEO);
                        }
                    }

                    if (userManage.AddUser(usersEO) > 0)
                    {
                        //插入操作日志
                        InsertLog(Resources.Resource.Create_user, string.Format("username:{0},id:{1}", usersEO.UrName, usersEO.UrId), 4, GetPlatformIdByValue(1));
                        CloseDivImplementation();
                        Jswork.Alert("代理信息创建成功!", "UsersAgentList.aspx"); //ShowCommonDlg("代理信息创建成功!");
                    }
                    else
                    {
                        //Jswork.Alert("用户信息创建失败", this.Page);
                        //this.divAlert.Visible = true;
                        //this.lblAlert.Text = Resources.Resource.User_information_creation_failed;//"用户信息创建失败";
                        ShowCommonDlg("代理信息创建失败!");
                    }
                }
                #endregion

                CloseDivImplementation();
            }
        }