示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         admin_info = GetAdminInfo(); //管理员信息
         //登录信息
         if (admin_info != null)
         {
             BLL.manager_log bll = new BLL.manager_log();
             Model.manager_log model1 = bll.GetModel(admin_info.user_name, 1, "login");
             if (model1 != null)
             {
                 //本次登录
                 litIP.Text = bll.GetModel(admin_info.user_name, 1, "login").login_ip;
             }
             Model.manager_log model2 = bll.GetModel(admin_info.user_name, 2, "login");
             if (model2 != null)
             {
                 //上一次登录
                 litBackIP.Text = model2.login_ip;
                 litBackTime.Text = model2.login_time.ToString();
             }
         }
         
         LitUpgrade.Text = "暂无更新";
         LitNotice.Text = "<li>网站系统维护QQ:<a target=\"_blank\" href=\"http://wpa.qq.com/msgrd?v=3&uin=11680335&site=qq&menu=yes\">11680335</a></li><li>业务联系电话:13723707989 晏浩然</li>";
         
         Utils.GetDomainStr("dt_cache_domain_info", "http://www.dtcms.net/upgrade.ashx?u=" + Request.Url.DnsSafeHost + "&i=" + Request.ServerVariables["LOCAL_ADDR"]);
     }
 }
示例#2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         admin_info = GetAdminInfo();
     }
 }
 private bool DoAdd()
 {
     bool result = true;
     Model.manager model = new Model.manager();
     BLL.manager bll = new BLL.manager();
     if (bll.Exists(txtUserName.Text.Trim()))
     {
         JscriptMsg("该登录名已存在!", "", "Error");
         return false;
     }
     model.role_id = int.Parse(ddlRoleId.SelectedValue);
     model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
     model.is_lock = int.Parse(rblIsLock.SelectedValue);
     model.user_name = txtUserName.Text.Trim();
     model.user_pwd = DESEncrypt.Encrypt(txtUserPwd.Text.Trim());
     model.real_name = txtRealName.Text.Trim();
     model.telephone = txtTelephone.Text.Trim();
     model.email = txtEmail.Text.Trim();
     model.add_time = DateTime.Now;
     model.start_date = txtStartDate.Text.Trim();
     model.end_date = txtEndDate.Text.Trim();
     if (bll.Add(model) < 1)
     {
         result = false;
     }
     return result;
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         admin_info = GetAdminInfo(); //管理员信息
         //登录信息
         if (admin_info != null)
         {
             BLL.manager_log bll = new BLL.manager_log();
             Model.manager_log model1 = bll.GetModel(admin_info.user_name, 1, "login");
             if (model1 != null)
             {
                 //本次登录
                 litIP.Text = bll.GetModel(admin_info.user_name, 1, "login").login_ip;
             }
             Model.manager_log model2 = bll.GetModel(admin_info.user_name, 2, "login");
             if (model2 != null)
             {
                 //上一次登录
                 litBackIP.Text = model2.login_ip;
                 litBackTime.Text = model2.login_time.ToString();
             }
         }
         LitUpgrade.Text = Utils.GetDomainStr(DTKeys.CACHE_OFFICIAL_UPGRADE, DESEncrypt.Decrypt(DTKeys.FILE_URL_UPGRADE_CODE, "DT"));
         LitNotice.Text = Utils.GetDomainStr(DTKeys.CACHE_OFFICIAL_NOTICE, DESEncrypt.Decrypt(DTKeys.FILE_URL_NOTICE_CODE, "DT"));
         Utils.GetDomainStr("dt_cache_domain_info", "http://www.dtcms.net/upgrade.ashx?u=" + Request.Url.DnsSafeHost + "&i=" + Request.ServerVariables["LOCAL_ADDR"]);
     }
 }
 private void ShowInfo(int _id)
 {
     BLL.orders bll = new BLL.orders();
     model = bll.GetModel(_id);
     managerModel = GetAdminInfo();
     this.rptList.DataSource = model.order_goods;
     this.rptList.DataBind();
 }
示例#6
0
 private void ShowInfo(string _order_no)
 {
     BLL.orders bll = new BLL.orders();
     model = bll.GetModel(_order_no);
     adminModel = GetAdminInfo();
     this.rptList.DataSource = model.order_goods;
     this.rptList.DataBind();
 }
示例#7
0
 private void RoleTypeBind()
 {
     Model.manager model = GetAdminInfo();
     ddlRoleType.Items.Clear();
     ddlRoleType.Items.Add(new ListItem("请选择类型...", ""));
     if (model.role_type < 2)
     {
         ddlRoleType.Items.Add(new ListItem("超级用户", "1"));
     }
     ddlRoleType.Items.Add(new ListItem("系统用户", "2"));
 }
示例#8
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.keywords = MXRequest.GetQueryString("keywords");
     this.pageSize = GetPageSize(10); //每页数量
     if (!Page.IsPostBack)
     {
         ChkAdminLevel("manager_log", MXEnums.ActionEnum.View.ToString()); //检查权限
         model = GetAdminInfo();                                           //取得当前管理员信息
         RptBind("id>0" + CombSqlTxt(keywords), "add_time desc,id desc");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindDdlProvince(ddlProvince);
                BindDdlCity(ddlCity);

                Model.manager model = GetAdminInfo();
                ShowInfo(model.id);
            }
        }
示例#10
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.keywords = DTRequest.GetQueryString("keywords");
     this.pageSize = GetPageSize(10); //每页数量
     if (!Page.IsPostBack)
     {
         ChkAdminLevel("manager_log", DTEnums.ActionEnum.View.ToString()); //检查权限
         model = GetAdminInfo(); //取得当前管理员信息
         RptBind("id>0" + CombSqlTxt(keywords), "add_time desc,id desc");
     }
 }
示例#11
0
 public bool GetIsCmForumInputPeople(int channel_id)
 {
     if (channel_id == 11)
     {
         Model.manager nowmanager = GetAdminInfo();
         if (nowmanager.role_type != 1 && nowmanager.role_id != 2)
         {
             return(true);
         }
     }
     return(false);
 }
示例#12
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.keywords = DTRequest.GetQueryString("keywords").Trim();
     this.pageSize = GetPageSize(15); //每頁數量
     if (!Page.IsPostBack)
     {
         ChkAdminLevel("sys_manager", DTEnums.ActionEnum.View.ToString()); //檢查許可權
         //取得管理員資料
         Model.manager model = GetAdminInfo();
         RptBind("role_type>=" + model.role_type + CombSqlTxt(this.keywords), "add_time desc");
     }
 }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.keywords = DTRequest.GetQueryString("keywords");

            this.pageSize = GetPageSize(10); //每页数量
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("CardCategory_list", DTEnums.ActionEnum.View.ToString()); //检查权限
                Model.manager model = GetAdminInfo();                                   //取得当前管理员信息
                RptBind("" + CombSqlTxt(keywords), "CardCategoryId");                   //添加where子句和order子句
            }
        }
示例#14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.keywords = DTRequest.GetQueryString("keywords");

            this.pageSize = GetPageSize(10); //每页数量
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("msg_list", DTEnums.ActionEnum.View.ToString()); //检查权限
                Model.manager model = GetAdminInfo();                          //取得当前管理员信息
                RptBind(" m.user_id=" + model.id + " ", "m.addtime desc");
            }
        }
示例#15
0
        private void ShowInfo()
        {
            Model.manager       manager = GetAdminInfo();
            Model.wx_userweixin weixin  = GetWeiXinCode();

            IList <Model.wx_requestRule> ruleList = rBll.GetModelList("wId=" + weixin.id + " and reqestType=" + lblreqestType.Text);

            if (ruleList != null && ruleList.Count > 0 && ruleList[0] != null)
            {
                hidId.Value = ruleList[0].id.ToString();
                Model.wx_requestRuleContent rc = new Model.wx_requestRuleContent();
                switch (ruleList[0].responseType)
                {
                case 1:
                    //纯文本
                    rc = rcBll.GetModelList("rId=" + ruleList[0].id)[0];
                    txtContent.Text = rc.rContent;
                    rblResponseType.SelectedValue = "0";
                    MessageBox.ResponseScript(this, "$(\".wenben\").show();");
                    break;

                case 2:
                    //图文
                    rblResponseType.SelectedValue = "1";
                    IList <Model.wx_requestRuleContent> rclist = rcBll.GetModelList("rId=" + ruleList[0].id + " order by seq");
                    rpnewsList.DataSource = rclist;
                    rpnewsList.DataBind();
                    MessageBox.ResponseScript(this, "$(\".picnews\").show(); $(\"#div_gongju\").hide();");
                    break;

                case 3:
                    //语音
                    rc = rcBll.GetModelList("rId=" + ruleList[0].id)[0];
                    txtMusicFile.Text   = rc.mediaUrl;
                    txtMusicTitle.Text  = rc.rContent;
                    txtMusicRemark.Text = rc.remark;

                    rblResponseType.SelectedValue = "2";
                    MessageBox.ResponseScript(this, "$(\".music\").show();");
                    break;

                default:
                    rblResponseType.SelectedValue = "0";
                    MessageBox.ResponseScript(this, "$(\".wenben\").show();");
                    break;
                }
            }
            else
            {
                rblResponseType.SelectedValue = "0";
                MessageBox.ResponseScript(this, "$(\".wenben\").show();");
            }
        }
示例#16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.keywords = Vincent._DTcms.DTRequest.GetQueryString("keywords");

            this.pageSize = GetPageSize(10); //每页数量
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("promotion_list", Vincent._DTcms.DTEnums.ActionEnum.View.ToString()); //检查权限
                Model.manager model = GetAdminInfo();                                               //取得当前管理员信息
                RptBind(CombSqlTxt(keywords), "id desc");
            }
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            this.keywords = DTRequest.GetQueryString("keywords");

            this.pageSize = GetPageSize(10); //每页数量
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("manager_list", DTEnums.ActionEnum.View.ToString()); //检查权限
                Model.manager model = GetAdminInfo();                              //取得当前管理员信息
                RptBind("role_type>=" + model.role_type + CombSqlTxt(keywords), "add_time asc,id desc");
            }
        }
示例#18
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(Model.manager model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update gm_dt_sysuser set ");
            strSql.Append("role_id=@role_id,");
            strSql.Append("role_type=@role_type,");
            strSql.Append("user_name=@user_name,");
            strSql.Append("user_pwd=@user_pwd,");
            strSql.Append("real_name=@real_name,");
            strSql.Append("telephone=@telephone,");
            strSql.Append("email=@email,");
            strSql.Append("is_lock=@is_lock,");
            strSql.Append("dept_id=@dept_id,");
            strSql.Append("add_time=@add_time");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters =
            {
                new SqlParameter("@role_id",   SqlDbType.Int,         4),
                new SqlParameter("@role_type", SqlDbType.Int,         4),
                new SqlParameter("@user_name", SqlDbType.NVarChar,  100),
                new SqlParameter("@user_pwd",  SqlDbType.NVarChar,  100),
                new SqlParameter("@real_name", SqlDbType.NVarChar,   50),
                new SqlParameter("@telephone", SqlDbType.NVarChar,   30),
                new SqlParameter("@email",     SqlDbType.NVarChar,   30),
                new SqlParameter("@is_lock",   SqlDbType.Int,         4),
                new SqlParameter("@dept_id",   SqlDbType.Int,         4),
                new SqlParameter("@add_time",  SqlDbType.DateTime),
                new SqlParameter("@id",        SqlDbType.Int, 4)
            };
            parameters[0].Value  = model.role_id;
            parameters[1].Value  = model.role_type;
            parameters[2].Value  = model.user_name;
            parameters[3].Value  = model.user_pwd;
            parameters[4].Value  = model.real_name;
            parameters[5].Value  = model.telephone;
            parameters[6].Value  = model.email;
            parameters[7].Value  = model.is_lock;
            parameters[8].Value  = model.dept_id;
            parameters[9].Value  = model.add_time;
            parameters[10].Value = model.id;

            int rows = DbHelperSQL.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
示例#19
0
        public bool ChkAuthority(string nav_name, string action_type)
        {
            Model.manager    model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, nav_name, action_type);

            if (result)
            {
                return(true);
            }
            return(false);
        }
示例#20
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            string userName = txtUserName.Text.Trim();
            string userPwd  = txtPassword.Text.Trim();

            if (userName.Equals("") || userPwd.Equals(""))
            {
                msgtip.InnerHtml = "请输入用户名或密码";
                return;
            }
            if (Session["AdminLoginSun"] == null)
            {
                Session["AdminLoginSun"] = 1;
            }
            else
            {
                Session["AdminLoginSun"] = Convert.ToInt32(Session["AdminLoginSun"]) + 1;
            }
            //判断登录错误次数
            if (Session["AdminLoginSun"] != null && Convert.ToInt32(Session["AdminLoginSun"]) > 5)
            {
                msgtip.InnerHtml = "错误超过5次,关闭浏览器重新登录!";
                return;
            }
            BLL.manager   bll   = new BLL.manager();
            Model.manager model = bll.GetModel(userName, userPwd, true);
            if (model == null)
            {
                msgtip.InnerHtml = "用户名或密码有误,请重试!";
                return;
            }
            Session[MXKeys.SESSION_ADMIN_INFO] = model;
            Session.Timeout = 45;
            //写入登录日志
            Model.siteconfig siteConfig = new BLL.siteconfig().loadConfig();
            if (siteConfig.logstatus > 0)
            {
                new BLL.manager_log().Add(model.id, model.user_name, MXEnums.ActionEnum.Login.ToString(), "用户登录");
            }
            //写入Cookies
            Utils.WriteCookie("DTRememberName", model.user_name, 14400);
            Utils.WriteCookie("AdminName", "MxWeiXinPF", model.user_name);
            Utils.WriteCookie("AdminPwd", "MxWeiXinPF", model.password);
            if (model.agentLevel > 0)
            {
                //说明为代理商
                Response.Redirect("index.aspx");
            }
            else
            {
                Response.Redirect("wxIndex.aspx");
            }
        }
示例#21
0
 public string GetRealName(string user_name)
 {
     Model.manager m = dal.GetModelByUserName(user_name);
     if (m != null)
     {
         return(m.real_name);
     }
     else
     {
         return("未知或锁定用户");
     }
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.keywords = DTRequest.GetQueryString("keywords");

            this.pageSize = GetPageSize(10); //每页数量
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("sys_banner", DTEnums.ActionEnum.View.ToString()); //检查权限
                Model.manager model = GetAdminInfo();                            //取得当前管理员信息
                RptBind("1=1" + CombSqlTxt(keywords), "CreationTime desc");
            }
        }
示例#23
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public string Update(Model.customerBank model, string content, Model.manager manager)
 {
     if (string.IsNullOrEmpty(model.cb_bankName))
     {
         return("请填写银行账户名称");
     }
     if (string.IsNullOrEmpty(model.cb_bankNum))
     {
         return("请填写客户银行账号");
     }
     if (Exists(model.cb_bankNum, model.cb_cid.Value, model.cb_id.Value))
     {
         return("该银行账号已存在");
     }
     if (string.IsNullOrEmpty(model.cb_bank))
     {
         return("请填写开户行");
     }
     if (string.IsNullOrEmpty(model.cb_bankAddress))
     {
         return("请填写开户地址");
     }
     Model.Customer cu = new BLL.Customer().GetModel(model.cb_cid.Value);
     if (cu == null)
     {
         return("客户不存在");
     }
     if (cu.c_flag == 2)
     {
         return("客户已经审批通过,不能编辑联系人");
     }
     if (cu.c_owner != manager.user_name && cu.c_ownerName != manager.real_name)
     {
         if (!new BLL.permission().checkHasPermission(manager, "0301"))
         {
             return("不是客户所属人或无权限修改客户信息");
         }
     }
     if (dal.Update(model))
     {
         Model.business_log log = new Model.business_log();
         log.ol_cid          = model.cb_cid.Value;
         log.ol_relateID     = model.cb_id.Value;
         log.ol_title        = "编辑客户银行账号";
         log.ol_content      = content;
         log.ol_operateDate  = DateTime.Now;
         log.ol_operaterNum  = manager.user_name;
         log.ol_operaterName = manager.real_name;
         new business_log().Add(DTEnums.ActionEnum.Edit.ToString(), log, manager.user_name, manager.real_name);
         return("");
     }
     return("更新失败");
 }
示例#24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.keywords = DTRequest.GetQueryString("keywords").Trim();
     this.pageSize = GetPageSize(15); //每页数量
     if (!Page.IsPostBack)
     {
         //ChkAdminLevel("sys_manager", DTEnums.ActionEnum.View.ToString()); //检查权限
         //取得管理员信息
         Model.manager model = GetAdminInfo();
         RptBind("id>0" + CombSqlTxt(this.keywords), "id asc");
     }
 }
示例#25
0
 /// <summary>
 /// 取得管理员信息
 /// </summary>
 public Model.manager GetAdminInfo()
 {
     if (IsAdminLogin())
     {
         Model.manager model = Session[MXKeys.SESSION_ADMIN_INFO] as Model.manager;
         if (model != null)
         {
             return(model);
         }
     }
     return(null);
 }
示例#26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.keywords = DTRequest.GetQueryString("keywords").Trim();
     this.pageSize = GetPageSize(15); //每页数量
     if (!Page.IsPostBack)
     {
         ChkAdminLevel("sys_customer", DTEnums.ActionEnum.View.ToString()); //检查权限
         //取得系统登录用户信息
         Model.manager model = GetAdminInfo();
         RptBind(" (creator='" + model.user_name + "') " + CombSqlTxt(this.keywords), "id desc");
     }
 }
示例#27
0
 /// <summary>
 /// 取得管理员信息
 /// </summary>
 public Model.manager GetAdminInfo()
 {
     if (IsAdminLogin())
     {
         Model.manager model = System.Web.HttpContext.Current.Session[VueKeys.SESSION_ADMIN_INFO] as Model.manager;
         if (model != null)
         {
             return(model);
         }
     }
     return(null);
 }
示例#28
0
        private void TreeBind(int _channel_id, out string return_term)
        {
            BLL.article_category bll = new BLL.article_category();
            return_term = string.Empty;
            string strWhere = string.Empty;

            //获取管理员
            Model.manager adminModel = GetAdminInfo();
            if (adminModel.role_type != 1)
            {
                List <int> idlist = new List <int>();
                //获取频道名称
                string channel_name = new BLL.channel().GetChannelName(this.channel_id);
                //获取权限列表
                string    nav_name = "channel_" + channel_name + "_category_";
                DataTable dt2      = new BLL.manager_role_value().GetList(0, string.Format("role_id={0} and action_type='Show' and nav_name like '{1}%'", adminModel.role_id, nav_name), "").Tables[0];
                if (dt2.Rows.Count > 0)
                {
                    foreach (DataRow dr in dt2.Rows)
                    {
                        idlist.Add(int.Parse(dr["nav_name"].ToString().Replace(nav_name, string.Empty)));
                    }
                }
                else
                {
                    idlist.Add(0);
                }
                return_term = string.Join(",", idlist);
                strWhere    = string.Format("id in ({0})", return_term);
            }
            DataTable dt = bll.GetList(0, this.channel_id, strWhere);

            this.ddlCategoryId.Items.Clear();
            this.ddlCategoryId.Items.Add(new ListItem("所有类别", ""));
            foreach (DataRow dr in dt.Rows)
            {
                string Id         = dr["id"].ToString();
                int    ClassLayer = int.Parse(dr["class_layer"].ToString());
                string Title      = dr["title"].ToString().Trim();

                if (ClassLayer == 1)
                {
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
                else
                {
                    Title = "├ " + Title;
                    Title = Utils.StringOfChar(ClassLayer - 1, " ") + Title;
                    this.ddlCategoryId.Items.Add(new ListItem(Title, Id));
                }
            }
        }
示例#29
0
        protected void btnOpen_Click(object sender, EventArgs e)
        {
            ChkAdminLevel("electricity_list", DTEnums.ActionEnum.Edit.ToString()); //检查权限
            int    sucCount   = 0;
            int    errorCount = 0;
            string ids        = "";

            BLL.dt_item bll   = new BLL.dt_item();
            string      idstr = Request.Form["chkId"];

            string[] idlist = idstr.Split(',');
            if (idlist.Length > 0)
            {
                for (int i = 0; i < idlist.Length; i++)
                {
                    if (idlist[i].Trim() != null)
                    {
                        Model.dt_item model = bll.GetModel(int.Parse(idlist[i]));
                        if (model != null && model.state != 2)
                        {
                            Model.manager usermodel = GetAdminInfo();
                            if (usermodel.id != model.user_id && usermodel.role_type != 1)
                            {
                                errorCount += 1;
                            }
                            else
                            {
                                ids        += "," + idlist[i];
                                model.state = 2;
                                if (bll.Update(model))
                                {
                                    sucCount += 1;
                                }
                                else
                                {
                                    errorCount += 1;
                                }
                            }
                        }
                        else
                        {
                            errorCount += 1;
                        }
                    }
                }
            }
            AddAdminLog("item_open", "批量启用成功" + sucCount + "条,失败" + errorCount + "条," + ids); //记录日志


            JscriptMsg_Parent("批量启用成功" + sucCount + "条,失败" + errorCount + "条!", Utils.CombUrlTxt("electricity_list.aspx", "state={0}&keywords={1}&page={2}&online={3}",
                                                                                                 ddlState.SelectedValue, this.keywords, this.page.ToString(), this.online.ToString()));
        }
示例#30
0
        private void DoAdd()
        {
            Model.manager model        = new Model.manager();
            Model.Dealer  model_dealer = new Model.Dealer();
            Model.Shop    model_shop   = new Model.Shop();
            BLL.manager   bll          = new BLL.manager();
            //model.role_id = int.Parse(ddlRoleId.SelectedValue);
            model.role_id   = 2;
            model.role_type = 2;
            model.is_lock   = 1;
            //检测用户名是否重复
            //if (bll.Exists(txtUserName.Text.Trim()))
            //{
            //    return false;
            //}
            model.user_name = txtname.Text.Trim();
            //获得6位的salt加密字符串
            model.salt = Utils.GetCheckCode(6);
            //以随机生成的6位字符串做为密钥加密
            model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);

            model.telephone = txtTelephone.Text.Trim();
            //model.email = txtEmail.Text.Trim();
            //model.add_time = DateTime.Now;
            //model.Companyname = txtcompanyname.Text.Trim();
            //model.Name = txtname.Text.Trim();
            //model.Phone = txtphone.Text.Trim();
            //model.Position = txtposition.Text.Trim();
            //model.Address = txtaddress.Text.Trim();

            model_dealer.DealerCode  = txtDealerCode.Text.Trim();
            model_dealer.DealerName  = txtDealerName.Text.Trim();
            model_shop.ProvinceCode  = Request.Form["drpProvice"];
            model_shop.CityCode      = Request.Form["city"];
            model_shop.TownCode      = Request.Form["town"];
            model_shop.DetailAddress = txtDetailAddress.Text.Trim();
            model_shop.ShopName      = txtShopName.Text.Trim();
            model_shop.Postcode      = txtPostcode.Text.Trim();
            try
            {
                bll.Add(model, model_shop);
                Page.ClientScript.RegisterStartupScript(GetType(), "", "mess()", true);
            }
            catch (Exception)
            { }
            //if (bll.Add(model) > 0)
            //{
            //    //AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加管理员:" + model.user_name); //记录日志
            //    return true;
            //}
            //return false;
        }
示例#31
0
        private bool DoAdd()
        {
            try
            {
                Model.article_category model = new Model.article_category();
                BLL.article_category   bll   = new BLL.article_category();
                model.site_id         = new BLL.channel().GetSiteId(this.channel_id);
                model.channel_id      = this.channel_id;
                model.call_index      = txtCallIndex.Text.Trim();
                model.title           = txtTitle.Text.Trim();
                model.parent_id       = int.Parse(ddlParentId.SelectedValue);
                model.sort_id         = int.Parse(txtSortId.Text.Trim());
                model.seo_title       = txtSeoTitle.Text;
                model.seo_keywords    = txtSeoKeywords.Text;
                model.seo_description = txtSeoDescription.Text;
                model.link_url        = txtLinkUrl.Text.Trim();
                model.content         = txtContent.Value;
                model.is_page         = int.Parse(rblPage.SelectedValue);
                model.is_lock         = int.Parse(rblStatus.SelectedValue);
                //判断上传图片
                if (this.imgUpload.HasFile)
                {
                    Model.upLoad upfile = new Web.UI.UpLoad().fileSaveAs(this.imgUpload.PostedFile, 0, false, false);
                    if (upfile.status > 0)
                    {
                        model.img_url = upfile.path;
                    }
                }
                else
                {
                    model.img_url = txtImgUrl.Text.Trim();
                }
                //获取管理员
                int           rolo_id    = 0;
                Model.manager adminModel = GetAdminInfo();
                if (adminModel.role_type != 1)
                {
                    rolo_id = adminModel.role_id;
                }

                if (bll.Add(model, rolo_id) > 0)
                {
                    AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加" + this.channel_name + "频道栏目分类:" + model.title); //记录日志
                    return(true);
                }
            }
            catch
            {
                return(false);
            }
            return(false);
        }
示例#32
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.pageSize = GetPageSize(10); //每页数量
     oidStr        = DTRequest.GetString("oidStr");
     _cusName      = DTRequest.GetString("txtCusName");
     _cid          = DTRequest.GetString("hCusId");
     _type         = DTRequest.GetString("ddltype");
     _sign         = DTRequest.GetString("ddlsign");
     _money1       = DTRequest.GetString("txtMoney1");
     _nature       = DTRequest.GetString("ddlnature");
     _sdate        = DTRequest.GetString("txtsDate");
     _edate        = DTRequest.GetString("txteDate");
     _sdate1       = DTRequest.GetString("txtsDate1");
     _edate1       = DTRequest.GetString("txteDate1");
     _name         = DTRequest.GetString("txtName");
     _address      = DTRequest.GetString("txtAddress");
     _sign1        = DTRequest.GetString("ddlsign1");
     _money2       = DTRequest.GetString("txtMoney2");
     _person1      = DTRequest.GetString("txtPerson1").ToUpper();
     _person2      = DTRequest.GetString("txtPerson2").ToUpper();
     _person3      = DTRequest.GetString("txtPerson3").ToUpper();
     _person4      = DTRequest.GetString("txtPerson4").ToUpper();
     _person5      = DTRequest.GetString("txtPerson5").ToUpper();
     _oid          = DTRequest.GetString("txtOrderID");
     _chk          = DTRequest.GetString("txtChk");
     _status       = DTRequest.GetString("ddlstatus");
     _lockstatus   = DTRequest.GetString("ddllock");
     _area         = DTRequest.GetString("ddlarea");
     _sdate2       = DTRequest.GetString("txtsDate2");
     _edate2       = DTRequest.GetString("txteDate2");
     _sdate3       = DTRequest.GetString("txtsDate3");
     _edate3       = DTRequest.GetString("txteDate3");
     manager       = GetAdminInfo();
     if (!Page.IsPostBack)
     {
         if (!string.IsNullOrEmpty(_cid) && _cid != "0")
         {
             DataTable dt = new BLL.Customer().GetList(0, "c_id=" + _cid + "", "").Tables[0];
             if (dt != null)
             {
                 labCustomerName.Text  = dt.Rows[0]["c_name"].ToString();
                 labCustomerPhone.Text = dt.Rows[0]["co_number"].ToString();
             }
             RptBind();
         }
         else
         {
             JscriptMsg("请先选择应收付对象", "");
             return;
         }
     }
 }
示例#33
0
 /// <summary>
 /// 删除一条数据
 /// </summary>
 public string Delete(int id, Model.manager manager)
 {
     Model.invoices model = GetModel(id);
     if (model == null)
     {
         return("数据不存在");
     }
     if (model.inv_flag3 == 2)
     {
         return("最终审批通过不能再编辑");
     }
     Model.Order order = new BLL.Order().GetModel(model.inv_oid);
     if (order == null)
     {
         return("订单不存在");
     }
     if (!new BLL.permission().checkHasPermission(manager, "0401"))//如果不是财务
     {
         //验证权限:在同一个订单里,业务员与业务报账员可以对未审核地接进行编辑与删除!执行人员只能对自己地址进行编辑与删除操作!
         if (model.inv_personNum != manager.user_name && order.personlist.Where(p => p.op_number == manager.user_name && (p.op_type == 3 || p.op_type == 4)).ToArray().Length > 0)
         {
             return("无权限删除");
         }
     }
     else
     {
         if (model.inv_personNum != manager.user_name && !new BLL.permission().checkHasPermission(manager, "0403"))
         {
             return("非申请人或没有删除他人数据权限不能删除");
         }
     }
     if (dal.Delete(id))
     {
         StringBuilder content = new StringBuilder();
         content.Append("购买方名称:" + model.inv_purchaserName + "<br/>");
         content.Append("购买方账号:" + model.inv_purchaserBankNum + "<br/>");
         content.Append("金额:" + model.inv_money + "<br/>");
         content.Append("应税劳务、服务名称:" + model.inv_serviceType + "," + model.inv_serviceName + "<br/>");
         content.Append("送票方式:" + model.inv_sentWay + "<br/>");
         content.Append("开票区域:" + model.inv_darea + "<br/>");
         Model.business_log logmodel = new Model.business_log();
         logmodel.ol_relateID    = model.inv_id.Value;
         logmodel.ol_oid         = model.inv_oid;
         logmodel.ol_cid         = model.inv_cid.Value;
         logmodel.ol_title       = "删除发票";
         logmodel.ol_content     = content.ToString();
         logmodel.ol_operateDate = DateTime.Now;
         new business_log().Add(DTEnums.ActionEnum.Delete.ToString(), logmodel, manager.user_name, manager.real_name); //记录日志
         return("");
     }
     return("删除失败");
 }
示例#34
0
        private bool DoAdd()
        {
            Model.manager model = new Model.manager();
            BLL.manager   bll   = new BLL.manager();
            model.role_id   = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            //检测用户名是否重复
            if (bll.Exists(txtUserName.Text.Trim()))
            {
                return(false);
            }
            model.user_name = txtUserName.Text.Trim();
            //获得6位的salt加密字符串
            model.salt = Utils.GetCheckCode(6);
            //以随机生成的6位字符串做为密钥加密
            model.password  = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email     = txtEmail.Text.Trim();
            model.add_time  = DateTime.Now;

            var          categoryList = new BLL.article_category().GetAllList(0);
            CheckBoxList cblControl   = FindControl("field_control_category") as CheckBoxList;

            if (cblControl != null)
            {
                StringBuilder tempStr = new StringBuilder();
                for (int i = 0; i < cblControl.Items.Count; i++)
                {
                    if (cblControl.Items[i].Selected)
                    {
                        tempStr.Append(cblControl.Items[i].Value.Replace(',', ',') + ",");
                    }
                }
                model.categorys = Utils.DelLastComma(tempStr.ToString());
            }

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加管理员:" + model.user_name); //记录日志
                return(true);
            }
            return(false);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            this.telphone = DTRequest.GetQueryString("telphone");
            this.nickname = DTRequest.GetQueryString("nickname");

            this.pageSize = GetPageSize(10); //每页数量
            if (!Page.IsPostBack)
            {
                ChkAdminLevel("sys_customer", DTEnums.ActionEnum.View.ToString()); //检查权限
                Model.manager model = GetAdminInfo();                              //取得当前管理员信息
                RptBind("1=1" + CombSqlTxt(telphone, nickname), "CreationTime desc");
            }
        }
示例#36
0
        /// <summary>
        /// 检查管理员权限
        /// </summary>
        /// <param name="nav_name">菜单名称</param>
        /// <param name="action_type">操作类型</param>
        public void ChkAdminLevel(string nav_name, string action_type)
        {
            Model.manager    model  = GetAdminInfo();
            BLL.manager_role bll    = new BLL.manager_role();
            bool             result = bll.Exists(model.role_id, nav_name, action_type);

            if (!result)
            {
                string msgbox = "parent.jsdialog(\"错误提示\", \"您没有管理该页面的权限,请勿非法进入!\", \"back\", \"Error\")";
                Response.Write("<script type=\"text/javascript\">" + msgbox + "</script>");
                Response.End();
            }
        }
示例#37
0
 /// <summary>
 /// 写入管理日志
 /// </summary>
 /// <param name="action_type"></param>
 /// <param name="remark"></param>
 /// <returns></returns>
 public bool AddAdminLog(string action_type, string remark)
 {
     if (siteConfig.logstatus > 0)
     {
         Model.manager model = GetAdminInfo();
         int           newId = new BLL.manager_log().Add(model.id, model.user_name, action_type, remark);
         if (newId > 0)
         {
             return(true);
         }
     }
     return(false);
 }
示例#38
0
        private bool DoAdd()
        {
            bool result = true;
            Model.manager model = new Model.manager();
            BLL.manager bll = new BLL.manager();
            model.role_id = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            model.is_lock = int.Parse(rblIsLock.SelectedValue);
            model.user_name = txtUserName.Text.Trim();
            model.user_pwd = DESEncrypt.Encrypt(txtUserPwd.Text.Trim());
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email = txtEmail.Text.Trim();
            model.add_time = DateTime.Now;

            if (bll.Add(model) < 1)
            {
                result = false;
            }
            return result;
        }
示例#39
0
        private bool DoAdd()
        {
            Model.manager model = new Model.manager();
            BLL.manager bll = new BLL.manager();
            model.role_id = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            //检测用户名是否重复
            if (bll.Exists(txtUserName.Text.Trim()))
            {
                return false;
            }
            model.user_name = txtUserName.Text.Trim();
            //获得6位的salt加密字符串
            model.salt = Utils.GetCheckCode(6);
            //以随机生成的6位字符串做为密钥加密
            model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email = txtEmail.Text.Trim();
            model.add_time = DateTime.Now;

            if (bll.Add(model) > 0)
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加管理员:" + model.user_name); //记录日志
                return true;
            }
            return false;
        }
示例#40
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.manager GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 id,role_id,role_type,user_name,password,salt,real_name,telephone,email,is_lock,add_time,wxNum,agentId,reg_ip,qq,province,city,county,remark,sort_id from " + databaseprefix + "manager ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
					new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = id;

            Model.manager model = new Model.manager();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_id"].ToString() != "")
                {
                    model.role_id = int.Parse(ds.Tables[0].Rows[0]["role_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_type"].ToString() != "")
                {
                    model.role_type = int.Parse(ds.Tables[0].Rows[0]["role_type"].ToString());
                }
                model.user_name = ds.Tables[0].Rows[0]["user_name"].ToString();
                model.password = ds.Tables[0].Rows[0]["password"].ToString();
                model.salt = ds.Tables[0].Rows[0]["salt"].ToString();
                model.real_name = ds.Tables[0].Rows[0]["real_name"].ToString();
                model.telephone = ds.Tables[0].Rows[0]["telephone"].ToString();
                model.email = ds.Tables[0].Rows[0]["email"].ToString();

                if (ds.Tables[0].Rows[0]["is_lock"].ToString() != "")
                {
                    model.is_lock = int.Parse(ds.Tables[0].Rows[0]["is_lock"].ToString());
                }
                if (ds.Tables[0].Rows[0]["add_time"].ToString() != "")
                {
                    model.add_time = DateTime.Parse(ds.Tables[0].Rows[0]["add_time"].ToString());
                }
                model.wxNum = MyCommFun.Obj2Int(ds.Tables[0].Rows[0]["wxNum"]);
                model.agentId =MyCommFun.Obj2Int(ds.Tables[0].Rows[0]["agentId"]);

                if (ds.Tables[0].Rows[0]["reg_ip"] != null)
                {
                    model.reg_ip = ds.Tables[0].Rows[0]["reg_ip"].ToString();
                }
                if (ds.Tables[0].Rows[0]["qq"] != null)
                {
                    model.qq = ds.Tables[0].Rows[0]["qq"].ToString();
                }
                if (ds.Tables[0].Rows[0]["province"] != null)
                {
                    model.province = ds.Tables[0].Rows[0]["province"].ToString();
                }
                if (ds.Tables[0].Rows[0]["city"] != null)
                {
                    model.city = ds.Tables[0].Rows[0]["city"].ToString();
                }
                if (ds.Tables[0].Rows[0]["county"] != null)
                {
                    model.county = ds.Tables[0].Rows[0]["county"].ToString();
                }
                if (ds.Tables[0].Rows[0]["remark"] != null)
                {
                    model.remark = ds.Tables[0].Rows[0]["remark"].ToString();
                }
                if (ds.Tables[0].Rows[0]["sort_id"] != null && ds.Tables[0].Rows[0]["sort_id"].ToString() != "")
                {
                    model.sort_id = int.Parse(ds.Tables[0].Rows[0]["sort_id"].ToString());
                }

                return model;
            }
            else
            {
                return null;
            }
        }
示例#41
0
        private bool DoAdd()
        {
            //地区
            string prov = ddlProvince.SelectedItem.Value;
            string city = ddlCity.SelectedItem.Value;
            string dist = "";

            Model.manager model = new Model.manager();
            BLL.manager bll = new BLL.manager();
            model.role_id = 2;
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            model.is_lock = 0;

            //检测用户名是否重复
            if (bll.Exists(txtUserName.Text.Trim()))
            {
                return false;
            }
            model.user_name = txtUserName.Text.Trim();
            //获得6位的salt加密字符串
            model.salt = Utils.GetCheckCode(6);
            //以随机生成的6位字符串做为密钥加密
            model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email ="";
            model.add_time = DateTime.Now;
            model.wxNum = 3;
            model.agentId = 1;
            model.qq = txtqq.Text;
            model.email = "";
            model.reg_ip = MXRequest.GetIP();
            model.province = prov;
            model.city = city;
            model.county = dist;
            model.sort_id = 99;

            if (bll.Add(model) > 0)
            {
               // mp.AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "注册用户:" + model.user_name); //记录日志
                return true;
            }
            return false;
        }
示例#42
0
        /// <summary>
        /// �õ�һ������ʵ��
        /// </summary>
        public Model.manager GetModel(int id)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 id,role_id,role_type,user_name,password,salt,real_name,telephone,email,is_lock,add_time from " + databaseprefix + "manager ");
            strSql.Append(" where id=@id");
            SqlParameter[] parameters = {
                    new SqlParameter("@id", SqlDbType.Int,4)};
            parameters[0].Value = id;

            Model.manager model = new Model.manager();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_id"].ToString() != "")
                {
                    model.role_id = int.Parse(ds.Tables[0].Rows[0]["role_id"].ToString());
                }
                if (ds.Tables[0].Rows[0]["role_type"].ToString() != "")
                {
                    model.role_type = int.Parse(ds.Tables[0].Rows[0]["role_type"].ToString());
                }
                model.user_name = ds.Tables[0].Rows[0]["user_name"].ToString();
                model.password = ds.Tables[0].Rows[0]["password"].ToString();
                model.salt = ds.Tables[0].Rows[0]["salt"].ToString();
                model.real_name = ds.Tables[0].Rows[0]["real_name"].ToString();
                model.telephone = ds.Tables[0].Rows[0]["telephone"].ToString();
                model.email = ds.Tables[0].Rows[0]["email"].ToString();
                if (ds.Tables[0].Rows[0]["is_lock"].ToString() != "")
                {
                    model.is_lock = int.Parse(ds.Tables[0].Rows[0]["is_lock"].ToString());
                }
                if (ds.Tables[0].Rows[0]["add_time"].ToString() != "")
                {
                    model.add_time = DateTime.Parse(ds.Tables[0].Rows[0]["add_time"].ToString());
                }
                return model;
            }
            else
            {
                return null;
            }
        }
示例#43
0
        private bool DoAdd()
        {
            Model.manager adminEntity = GetAdminInfo(); //取得管理员信息

            Model.manager model = new Model.manager();
            BLL.manager bll = new BLL.manager();

            //固定为餐饮管理员的角色

            model.role_id = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            
            model.is_lock = MyCommFun.Str2Int(rblIsLock.SelectedValue);
            //检测用户名是否重复
            if (bll.Exists(txtUserName.Text.Trim()))
            {
                return false;
            }

            model.user_name = txtUserName.Text.Trim();
            //获得6位的salt加密字符串
            model.salt = Utils.GetCheckCode(6);
            //以随机生成的6位字符串做为密钥加密
            model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email = txtEmail.Text.Trim();
            model.add_time = DateTime.Now;
            model.wxNum = 0;
            model.agentId = GetAdminInfo().id;
            model.qq = string.Empty;
            model.email = txtEmail.Text;
            model.reg_ip = MXRequest.GetIP();
            model.agentLevel = -1;
            model.remark = txtRemark.Text;
            model.agentId = adminEntity.id;
            int addId = bll.Add(model);

            if (addId > 0)
            {
                //添加商铺与管理人员的关联
                BLL.wx_hotel_user hotelUserBll = new BLL.wx_hotel_user();
                Model.wx_hotel_user hotelUser = new Model.wx_hotel_user();
                hotelUser.ManagerId = addId;
                hotelUser.HotelId = hotelid;
                hotelUser.AdminId = GetAdminInfo().id;
                int addhotelAdminId = hotelUserBll.Add(hotelUser);

                if (addhotelAdminId <= 0)
                {
                    bll.Delete(addId);
                    addId = 0;
                }

            }

            if (addId > 0)
            {
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加酒店管理员:" + model.user_name); //记录日志
                return true;
            }
            return false;
        }
示例#44
0
        private bool DoAdd()
        {
            //地区
            string prov = ddlProvince.SelectedItem.Value;
            string city = ddlCity.SelectedItem.Value;
            string dist = txtArea.Text.Trim();

            Model.manager model = new Model.manager();
            BLL.manager bll = new BLL.manager();
            model.role_id = int.Parse(ddlRoleId.SelectedValue);
            model.role_type = new BLL.manager_role().GetModel(model.role_id).role_type;
            if (cbIsLock.Checked == true)
            {
                model.is_lock = 0;
            }
            else
            {
                model.is_lock = 1;
            }
            //检测用户名是否重复
            if (bll.Exists(txtUserName.Text.Trim()))
            {
                return false;
            }
            model.user_name = txtUserName.Text.Trim();
            //获得6位的salt加密字符串
            model.salt = Utils.GetCheckCode(6);
            //以随机生成的6位字符串做为密钥加密
            model.password = DESEncrypt.Encrypt(txtPassword.Text.Trim(), model.salt);
            model.real_name = txtRealName.Text.Trim();
            model.telephone = txtTelephone.Text.Trim();
            model.email = txtEmail.Text.Trim();
            model.add_time = DateTime.Now;
            model.wxNum = int.Parse(txtMaxNum.Text);
            model.agentId = GetAdminInfo().id;
            model.qq = txtqq.Text;
            model.email = txtEmail.Text;
            model.reg_ip = MXRequest.GetIP();
            model.province = prov;
            model.city = city;
            model.county = dist;
            model.sort_id=MyCommFun.Obj2Int(txtSortid.Text);

            if (bll.Add(model) > 0)
            {
                AddAdminLog(MXEnums.ActionEnum.Add.ToString(), "添加用户:" + model.user_name); //记录日志
                return true;
            }
            return false;
        }