Пример #1
0
    public string ShowName(object o, int i)
    {
        string temp = string.Empty;
        string uid  = o.ToString().Split('-')[2].ToString();

        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
        tmm = tm.GetModel(Convert.ToInt64(uid));
        if (tmm != null)
        {
            switch (i)
            {
            case 1:
                temp = tmm.m_login;
                break;

            case 2:
                temp = tmm.m_name;
                break;

            case 3:
                temp = Tunnel.Data.DESEncrypt.Decrypt(tmm.m_password);
                break;

            default:
                break;
            }
        }
        return(temp);
    }
Пример #2
0
    protected void Button1_Click(object sender, EventArgs e)
    {
        try
        {
            string user = username.Value.Trim();
            string pass = password.Value.Trim();

            int userId = 0;
            Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
            ul.UserLoginCheck(user, Tunnel.Data.DESEncrypt.Encrypt(pass), Tunnel.Common.Common.GetIp(), ref userId);
            if (userId > 0)
            {
                Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
                Tunnel.Common.GetValue.OnLine(userId);
                Response.Redirect("Index.aspx");
            }
            else
            {
                Response.Write("<script>alert('账号或密码错误!');location.href='default.aspx';</script>");
                Response.End();
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }
Пример #3
0
    public string showShengRi()
    {
        string str2 = string.Empty;

        Tunnel.BLL.Tunnel_menber          tm     = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber        tmm    = new Tunnel.Model.Tunnel_menber();
        List <Tunnel.Model.Tunnel_menber> tmList = new List <Tunnel.Model.Tunnel_menber>();

        tmList = tm.GetModelList("1=1");
        for (int i = 0; i < tmList.Count; i++)
        {
            string shengRi  = tmList[i].m_birth.ToString();
            string userName = tmList[i].m_name;
            for (int j = 0; j < 100; j++)
            {
                if (DateTime.Compare(Convert.ToDateTime(shengRi).AddYears(j), DateTime.Today) == 0)
                {
                    str2 += userName + "<br/>";
                }
            }
        }
        if (str2.Length > 0)
        {
            str2 = str2.Substring(0, str2.Length - 1);
        }
        return(str2);
    }
Пример #4
0
 void ShowInit(string sql)
 {
     try
     {
         DataSet ds = new DataSet();
         string where = "b_sort=" + int.Parse(Request.Params["Flow"]);
         Tunnel.BLL.Tunnel_menber bm = new Tunnel.BLL.Tunnel_menber();
         ul.UsbnLogin = bm.GetModel(ul.LoginID);
         if ("search".Equals(sql))
         {
             if (DropDownList2.SelectedValue != "")
             {
                 where += " and b_state=" + DropDownList2.SelectedValue;
             }
             if (TextBox1.Text.Trim() != "")
             {
                 where += " and b_time>='" + TextBox1.Text + "'";
             }
             if (TextBox2.Text.Trim() != "")
             {
                 where += " and b_time<='" + TextBox2.Text + "'";
             }
             if (TextBox4.Text.Trim() != "")
             {
                 where += " and b_title like '%" + TextBox4.Text + "%'";
             }
             if (ul.JiaoSe(ul.LoginID) != "系统管理员")
             {
                 where += " and b_user="******" order by b_state asc,b_time desc";
             ds     = tb.GetList(where);
             //对用于分页的类的引用
         }
         else
         {
             if (ul.JiaoSe(ul.LoginID) != "系统管理员")
             {
                 where = "b_user="******" order by b_state asc,b_time desc";
             ds     = tb.GetList(where);
         }
         PagedDataSource pds = new PagedDataSource();
         pds.DataSource  = ds.Tables[0].DefaultView;//设置数据源(DataTable类型)
         pds.AllowPaging = true;
         //每页显示的行数
         //pds.PageSize = 12;
         AspNetPager1.RecordCount = ds.Tables[0].Rows.Count;
         pds.CurrentPageIndex     = AspNetPager1.CurrentPageIndex - 1;
         pds.PageSize             = AspNetPager1.PageSize;
         Repeater1.DataSource     = pds;
         Repeater1.DataBind();
     }
     catch
     {
         Tunnel.Common.Message.back("不正确的ID"); return;
     }
 }
Пример #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                id = Convert.ToInt32(Request.QueryString["id"].ToString());
                Tunnel.BLL.Tunnel_Vote   t  = new Tunnel.BLL.Tunnel_Vote();
                Tunnel.Model.Tunnel_Vote tt = new Tunnel.Model.Tunnel_Vote();
                Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
                tt = t.GetModel(id);

                voteTitle    = tt.vote_Title;
                voteUserName = tm.GetModel(Convert.ToInt32(tt.vote_userId)).m_name;
                voteDate     = Convert.ToDateTime(tt.vote_startDate).ToShortDateString();
                voteMark     = tt.vote_mark;
                voteMax      = tt.vote_max.ToString();
                voteType     = tt.vote_Type.ToString();
                max.Value    = voteMax;

                tvList = tv.GetModelList("ivote_voteId=" + id + "");
                Repeater1.DataSource = tvList;
                Repeater1.DataBind();
                if (voteType == "0")
                {
                    foreach (RepeaterItem item in Repeater1.Items)
                    {
                        ((CheckBox)item.FindControl("CheckBox1")).Visible = false;
                    }
                }
                else
                {
                    foreach (RepeaterItem item in Repeater1.Items)
                    {
                        ((RadioButton)item.FindControl("RadioButton1")).Visible = false;
                    }
                }
                Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
                bool b = false;
                foreach (Tunnel.Model.Tunnel_Votei item in tvList)
                {
                    string[] temp = item.ivote_yesUserId.Split(',');
                    foreach (string item1 in temp)
                    {
                        if (ul.LoginID.ToString() == item1)
                        {
                            b = true;
                        }
                    }
                }
                if (b)
                {
                    //Button1.Text = "查看结果";
                    Response.Redirect("VoteShow.aspx?id=" + Request.QueryString["id"].ToString());
                }
            }
        }
    }
Пример #6
0
    /// <summary>
    /// 页面数据绑定
    /// </summary>
    public void PageBind()
    {
        PageBase pb = new PageBase();

        pb.TblName       = "Tunnel_Vote";
        pb.FldName       = "vote_Id";
        pb.ProcedureName = "pagination";
        pb.PageSize      = pageSize;
        if (cuttentPage == 0)
        {
            cuttentPage = pb.PageIndex;
        }
        pb.PageIndex = cuttentPage;
        Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
        if (ul.LoginID == 1)
        {
            pb.StrWhere = "";
        }
        else
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel_menber();
            tmm = tm.GetModel(Convert.ToInt64(ul.LoginID));
            if (!string.IsNullOrEmpty(Convert.ToString(tmm.m_bum)))
            {
                pb.StrWhere = "(vote_bumGroup like '%" + tmm.m_bum + "%' or vote_bumgroup = '|' or vote_bumgroup ='') and (getdate()>vote_startDate and getdate()<vote_endDate) and vote_state=0";
            }
            else
            {
                pb.StrWhere = "(vote_bumGroup like '%adfadfadfadfadfa%' or vote_bumgroup = '|' or vote_bumgroup ='') and (getdate()>vote_startDate and getdate()<vote_endDate) and vote_state=0";
            }
        }
        int count = 0;
        List <Tunnel.Model.Tunnel_Vote> modelList = new List <Tunnel.Model.Tunnel_Vote>();

        modelList  = tbll.GetList(pb, ref count); //获取分页结果
        pb.DoCount = 1;
        tbll.GetList(pb, ref count);              //获取总条数


        //数据绑定
        Repeater1.DataSource = modelList;
        Repeater1.DataBind();

        //数据分页
        MTCPager1.PageSize    = pageSize;
        MTCPager1.RecordCount = count;
        MTCPager1.PageIndex   = cuttentPage;
        if (count <= pb.PageSize)
        {
            MTCPager1.Visible = false;
        }
        else
        {
            MTCPager1.Visible = true;
        }
    }
Пример #7
0
 public string showuid(string uname)
 {
     Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
     if (tm.GetModelList(" m_name = '" + ren.Trim() + "'").Count > 0)
     {
         return(tm.GetModelList("  m_name = '" + ren.Trim() + "'")[0].m_id.ToString());
     }
     else
     {
         return("-1");
     }
 }
Пример #8
0
 public string showname(object uid)
 {
     Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
     if (tm.GetModel(Convert.ToInt64(uid.ToString())) != null)
     {
         return(tm.GetModel(Convert.ToInt64(uid.ToString())).m_name);
     }
     else
     {
         return("");
     }
 }
Пример #9
0
    public string ShowName(object o)
    {
        string a = string.Empty;

        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
        tmm = tm.GetModel(Convert.ToInt64(o.ToString()));
        if (tmm != null)
        {
            a = tmm.m_name;
        }
        return(a);
    }
Пример #10
0
    /// <summary>
    /// 显示用户真实姓名
    /// </summary>
    /// <param name="Id">用户Id</param>
    /// <returns></returns>
    public string ShowUserName(string UserId)
    {
        Tunnel.BLL.Tunnel_menber   mbll  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber model = new Tunnel.Model.Tunnel_menber();
        model = mbll.GetModel(Convert.ToInt64(UserId));
        string strTemp = string.Empty;

        if (model != null)
        {
            strTemp = model.m_name;
        }
        return(strTemp);
    }
Пример #11
0
    public static string GetName(object o)
    {
        string temp = "";

        Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
        if (!string.IsNullOrEmpty(Convert.ToString(o)))
        {
            Tunnel.Model.Tunnel_menber tmm = tm.GetModel(Convert.ToInt64(o.ToString()));
            if (tmm != null)
            {
                temp = tmm.m_name;
            }
        }
        return(temp);
    }
Пример #12
0
    private void BindLinkman()
    {
        lbxlinkman.Items.Clear();
        Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
        DataSet das = new DataSet();

        das = tm.GetList("m_mail <> ''");
        foreach (DataRow rows in das.Tables[0].Rows)
        {
            ListItem item = new ListItem();
            item.Text  = rows["m_name"].ToString().Trim();
            item.Value = rows["m_mail"].ToString().Trim() + "[" + rows["m_name"].ToString().Trim() + "];";
            lbxlinkman.Items.Add(item);
        }
    }
Пример #13
0
    /// <summary>
    /// 得到所有权限
    /// </summary>
    public Dictionary <int, string> getAllPermission()
    {
        Dictionary <int, string> allDic = new Dictionary <int, string>();

        Tunnel.BLL.Tunnel_quanxian          tq     = new Tunnel.BLL.Tunnel_quanxian();
        List <Tunnel.Model.Tunnel_quanxian> tqList = new List <Tunnel.Model.Tunnel_quanxian>();

        if (ul.JiaoSe(ul.LoginID) == "系统管理员")
        {
            tqList = tq.GetModelList("1=1 order by q_rId asc ");
            foreach (Tunnel.Model.Tunnel_quanxian item in tqList)
            {
                allDic.Add(item.q_id, item.q_mark + "-->>" + item.q_name);
            }
        }
        else
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(ul.LoginID);
            if (!string.IsNullOrEmpty(Convert.ToString(tmm.m_bum)))
            {
                Tunnel.BLL.Tunnel_byingshe          tb     = new Tunnel.BLL.Tunnel_byingshe();
                Tunnel.Model.Tunnel_byingshe        tbb    = new Tunnel.Model.Tunnel_byingshe();
                List <Tunnel.Model.Tunnel_byingshe> tbList = new List <Tunnel.Model.Tunnel_byingshe>();
                tbList = tb.GetModelList("by_bid = " + tmm.m_bum + "");
                if (tbList.Count > 0)
                {
                    tbb = tbList[0];
                    string byList = tbb.by_list;
                    if (byList.Length > 0)
                    {
                        string[] temp = byList.Split('|');
                        foreach (string item in temp)
                        {
                            Tunnel.Model.Tunnel_quanxian tqq = new Tunnel.Model.Tunnel_quanxian();
                            tqq = tq.GetModel(int.Parse(item));
                            if (tqq != null)
                            {
                                allDic.Add(tqq.q_id, tqq.q_mark + "-->>" + tqq.q_name);
                            }
                        }
                    }
                }
            }
        }
        return(allDic);
    }
Пример #14
0
    public void BindSource()
    {
        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
        string sid = null == Request.QueryString["uid"] ? "" : Request.QueryString["uid"].ToString().Trim();

        if (sid != "")
        {
            sid = sid.Substring(0, sid.Length - 1);
            DataSet ds = tm.GetList(string.Format("m_id in ({0})", sid));
            cbListUser.DataSource     = ds;
            cbListUser.DataTextField  = "m_name";
            cbListUser.DataValueField = "m_id";
            cbListUser.DataBind();
        }
    }
Пример #15
0
 /// <summary>
 /// 得到 类型ID 和 ID
 /// </summary>
 public void getIdtypeId(ref int tmpId, ref int typeId)
 {
     if (!string.IsNullOrEmpty(Request.QueryString["uid"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["uid"].ToString());
         tempName = "用户管理";
         Tunnel.BLL.Tunnel_menber   menberBLL   = new Tunnel.BLL.Tunnel_menber();
         Tunnel.Model.Tunnel_menber menberModel = menberBLL.GetModel(tmpId);
         tempName_TypeName = menberModel.m_name;
         typeId            = 1;
         if (!string.IsNullOrEmpty(Request.QueryString["uid"]))
         {
             GetUserAllPermission(int.Parse(Request.QueryString["uid"]));
         }
     }
     if (!string.IsNullOrEmpty(Request.QueryString["jid"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["jid"].ToString());
         tempName = "角色管理";
         Tunnel.BLL.Tunnel_jiaose   jiaoseBLL   = new Tunnel.BLL.Tunnel_jiaose();
         Tunnel.Model.Tunnel_jiaose jiaoseModel = jiaoseBLL.GetModel(tmpId);
         tempName_TypeName   = jiaoseModel.j_name;
         this.tmpSet.Visible = false;
         typeId = 2;
     }
     if (!string.IsNullOrEmpty(Request.QueryString["did"]))
     {
         tmpId    = Convert.ToInt32(Request.QueryString["did"].ToString());
         tempName = "职位管理";
         Tunnel.BLL.Tunnel_duty   dutyBLL   = new Tunnel.BLL.Tunnel_duty();
         Tunnel.Model.Tunnel_duty dutyModel = dutyBLL.GetModel(tmpId);
         tempName_TypeName   = dutyModel.d_name;
         this.tmpSet.Visible = false;
         typeId = 3;
     }
     if (!string.IsNullOrEmpty(Request.QueryString["bid"]))
     {
         tmpId = Convert.ToInt32(Request.QueryString["bid"].ToString());
         Tunnel.BLL.Tunnel_bum   bumBLL    = new Tunnel.BLL.Tunnel_bum();
         Tunnel.Model.Tunnel_bum bumModels = bumBLL.GetModel(tmpId);
         tempName_TypeName   = bumModels.b_name;
         tempName            = "部门管理";
         this.tmpSet.Visible = false;
         typeId = 4;
     }
 }
Пример #16
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!string.IsNullOrEmpty(Request.QueryString["id"]))
         {
             voteId = Convert.ToInt32(Request.QueryString["id"].ToString());
             Tunnel.BLL.Tunnel_Vote   t  = new Tunnel.BLL.Tunnel_Vote();
             Tunnel.Model.Tunnel_Vote tt = new Tunnel.Model.Tunnel_Vote();
             Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
             tt        = t.GetModel(voteId);
             voteTitle = tt.vote_Title;
             voteMark  = tt.vote_mark;
             PageBind();
         }
     }
 }
Пример #17
0
    private void PageBind(int mailId)
    {
        Tunnel.BLL.Tunnel_mail   mail  = new Tunnel.BLL.Tunnel_mail();
        Tunnel.Model.Tunnel_mail model = new Tunnel.Model.Tunnel_mail();
        model           = mail.GetModel(mailId);
        tb_Title.Text   = "回复:" + model.m_title;
        tb_content.Text = "原信息内容:\n" + model.m_content.Replace(@"<br \>", "\n") + "\n" + model.m_time.ToString() + "\n-------------------------------\n";
        Tunnel.BLL.Tunnel_menber   menb = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber mmol = new Tunnel.Model.Tunnel_menber();
        mmol             = menb.GetModel(model.m_from);
        tb_toname.Text   = mmol.m_name + ",";
        id_toValue.Value = model.m_from.ToString() + ",";
        string priv_name = mmol.m_name;
        long   priv_id   = mmol.m_id;
        char   d         = '"';

        td_tomail.InnerHtml = priv_name + "<IMG id=" + priv_name + priv_id + " onclick=" + "'" + "removeimg(" + d + priv_name + d + "," + d + priv_id + d + ");" + "'" + " src=" + d + "../../image/remove.png" + d + ">,";
    }
Пример #18
0
    /// <summary>
    /// 办理中的用户
    /// </summary>
    /// <param name="ulist">用户ID列表</param>
    /// <returns></returns>
    private string getallUname(string ulist)
    {
        ulist = ulist.Substring(0, ulist.Length - 1);
        string unamelist = "";

        Tunnel.BLL.Tunnel_menber bm = new Tunnel.BLL.Tunnel_menber();
        DataSet ds = bm.GetList("m_id in(" + ulist + ")");

        if (ds.Tables[0].Rows.Count > 0)
        {
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                unamelist += dr["m_name"].ToString() + ",";
            }
            unamelist = unamelist.Substring(0, unamelist.Length - 1);
        }
        return(unamelist);
    }
Пример #19
0
    public void UserSave()
    {
        Tunnel.BLL.Tunnel_menber     tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.BLL.Tunnel_jiaose     tj  = new Tunnel.BLL.Tunnel_jiaose();
        Tunnel.Model.Tunnel_jiaose   tjj = new Tunnel_jiaose();
        Tunnel.Model.Tunnel_menber   tmm = new Tunnel.Model.Tunnel_menber();
        Tunnel.BLL.Tunnel_uyingshe   tu  = new Tunnel.BLL.Tunnel_uyingshe();
        Tunnel.Model.Tunnel_uyingshe tuu = new Tunnel_uyingshe();


        tmm.m_login    = txtName.Value.Trim();
        tmm.m_name     = txtName.Value.Trim();
        tmm.m_password = Tunnel.Data.DESEncrypt.Encrypt(txtPwd.Text.Trim());
        //tmm.m_mail = txtMail.Text.Trim();

        //if (Tunnel.Common.RegexComm.IsValidEmail(tmm.m_mail))
        //{
        if (tm.GetModelList("m_login='******'").Count == 0)
        {
            tmm.m_spassword = Tunnel.Data.DESEncrypt.Encrypt("123456");
            int i = tm.Add(tmm);
            if (i > 0)
            {
                tuu.uy_uid  = i.ToString();
                tuu.uy_list = "";
                tu.Add(tuu);
                Tunnel.Common.Message.Show("添加用户成功,请继续完善资料,审批密码默认为123456,请尽快修改!", "tunnel_userupd.aspx?updid=" + i.ToString() + "");
            }
            else
            {
                Tunnel.Common.Message.Show("注册失败");
            }
        }
        else
        {
            Tunnel.Common.Message.Show("用户名已占用");
        }
        //}
        //else
        //{
        //    Tunnel.Common.Message.Show("不是有效的邮箱名");
        //}
    }
Пример #20
0
    public string GetBum(object o)
    {
        Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber tmm = new Tunnel_menber();
        tmm = tm.GetModel(Convert.ToInt64(o.ToString()));
        string strTemp = string.Empty;

        if (tmm != null)
        {
            Tunnel_bum            tbb = new Tunnel_bum();
            Tunnel.BLL.Tunnel_bum tb  = new Tunnel.BLL.Tunnel_bum();
            tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum.ToString()));
            if (tbb != null)
            {
                strTemp = tbb.b_name;
            }
        }
        return(strTemp);
    }
Пример #21
0
    protected void Repeater2_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        Repeater rptSub = (Repeater)e.Item.FindControl("Repeater3");

        Tunnel.Model.Tunnel_bum model = (e.Item.DataItem as Tunnel.Model.Tunnel_bum);

        Tunnel.BLL.Tunnel_menber          userBll       = new Tunnel.BLL.Tunnel_menber();
        List <Tunnel.Model.Tunnel_menber> userModelList = new List <Tunnel_menber>();

        if (Convert.ToInt32(model.b_id) == 0)
        {
            userModelList = userBll.GetModelList(" m_bum = 0 ");
        }
        else
        {
            userModelList = userBll.GetModelList(" m_bum =  " + model.b_id);
        }

        rptSub.DataSource = userModelList;
        rptSub.DataBind();
    }
Пример #22
0
    protected void Page_Load(object sender, EventArgs e)
    {
        Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
        GridViewE.DataSource = tm.GetModelList("1=1");
        GridViewE.DataBind();

        StringWriter   sw = new StringWriter();
        HtmlTextWriter hw = new HtmlTextWriter(sw);

        this.GridViewE.RenderControl(hw);

        Response.Clear();
        Response.ContentType           = "application/vnd.ms-excel";
        Response.Charset               = "";
        GridViewE.Page.EnableViewState = true;
        Response.AppendHeader("Content-Disposition", "attachment;filename=\"txl.xls");
        Response.Write("<html><head><meta http-equiv=Content-Type content=\"text/html; charset=UTF8\"><title> adsf</title></head><body><table><tr><td> 帐号</td><td>姓名</td><td>电话</td><td>电子邮件</td></tr>");
        Response.Write(sw.ToString());
        Response.Write("</table></body></html>");
        Response.End();
    }
Пример #23
0
    public static string GetName(object o)
    {
        string[] temp  = null;
        string   temp1 = string.Empty;

        if (!string.IsNullOrEmpty(Convert.ToString(o)))
        {
            temp = o.ToString().Split(',');
            foreach (string item in temp)
            {
                if (!string.IsNullOrEmpty(item))
                {
                    Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
                    Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
                    tmm    = tm.GetModel(Convert.ToInt64(item.ToString()));
                    temp1 += tmm.m_name + ",";
                }
            }
        }

        return(temp1);
    }
Пример #24
0
        /// <summary>
        /// 用户角色名称
        /// </summary>
        public string JiaoSe(int userId)
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(Convert.ToInt64(userId.ToString()));
            string jiaose = "无角色";

            if (userId == 1)
            {
                jiaose = "系统管理员";
            }
            if (tmm.m_jiao != 0)
            {
                Tunnel_jiaose tj = new Tunnel_jiaose();
                Tunnel.Model.Tunnel_jiaose tjj = new Tunnel.Model.Tunnel_jiaose();
                tjj = tj.GetModel(Convert.ToInt64(tmm.m_jiao.ToString()));
                if (tjj != null)
                {
                    jiaose = tjj.j_name;
                }
            }
            return(jiaose);
        }
Пример #25
0
    public void ListBind()
    {
        nianyue = DropDownList1.SelectedValue;

        Tunnel.BLL.Tunnel_menber          tm     = new Tunnel.BLL.Tunnel_menber();
        Tunnel.Model.Tunnel_menber        tmm    = new Tunnel.Model.Tunnel_menber();
        List <Tunnel.Model.Tunnel_menber> tmList = new List <Tunnel.Model.Tunnel_menber>();

        Tunnel.BLL.Tunnel_work          tw     = new Tunnel.BLL.Tunnel_work();
        Tunnel.Model.Tunnel_work        tww    = new Tunnel.Model.Tunnel_work();
        List <Tunnel.Model.Tunnel_work> twList = new List <Tunnel.Model.Tunnel_work>();

        Tunnel.BLL.Tunnel_grade          tg     = new Tunnel.BLL.Tunnel_grade();
        Tunnel.Model.Tunnel_grade        tgg    = new Tunnel.Model.Tunnel_grade();
        List <Tunnel.Model.Tunnel_grade> tgList = new List <Tunnel.Model.Tunnel_grade>();

        Tunnel.BLL.Tunnel_items          ti     = new Tunnel.BLL.Tunnel_items();
        Tunnel.Model.Tunnel_items        tii    = new Tunnel.Model.Tunnel_items();
        List <Tunnel.Model.Tunnel_items> tiList = new List <Tunnel.Model.Tunnel_items>();

        Tunnel.BLL.Tunnel_check          tc     = new Tunnel.BLL.Tunnel_check();
        Tunnel.Model.Tunnel_check        tcc    = new Tunnel.Model.Tunnel_check();
        List <Tunnel.Model.Tunnel_check> tcList = new List <Tunnel.Model.Tunnel_check>();

        List <Tunnel.Model.Tunnel_ReadCheckList> trList = new List <Tunnel.Model.Tunnel_ReadCheckList>();

        tcList = tc.GetModelList("c_date='" + nianyue + "'");

        foreach (Tunnel.Model.Tunnel_check itemCheck in tcList)
        {
            Tunnel.Model.Tunnel_ReadCheckList tr    = new Tunnel.Model.Tunnel_ReadCheckList();
            List <Tunnel.Model.Tunnel_check>  clist = new List <Tunnel.Model.Tunnel_check>();

            tr.ItemsID   = Convert.ToInt32(itemCheck.c_itemsId);
            tr.ItemsName = ti.GetModel(Convert.ToInt32(itemCheck.c_itemsId)).i_name;
            tr.UserId    = Convert.ToInt32(itemCheck.c_userId);
            tr.UserName  = tm.GetModel(Convert.ToInt64(itemCheck.c_userId.ToString())).m_name;
            tgList       = tg.GetModelList("g_checkid=" + itemCheck.c_id + "");
            tr.AqscCent  = 0;
            tr.CbkzCent  = 0;
            tr.ClglCent  = 0;
            tr.DzbgzCent = 0;
            tr.GbgzCent  = 0;
            tr.GczlCent  = 0;
            tr.SbglCent  = 0;
            tr.ScjhCent  = 0;
            tr.WmsgCent  = 0;
            tr.XcgzCent  = 0;
            tr.XnzhCent  = 0;
            tr.XxgzCent  = 0;
            tr.ZhzlCent  = 0;
            if (tgList.Count > 0)
            {
                foreach (Tunnel.Model.Tunnel_grade item in tgList)
                {
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "成本控制")
                    {
                        tr.CbkzCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "虚拟账户")
                    {
                        tr.XnzhCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "生产计划")
                    {
                        tr.ScjhCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "文明施工")
                    {
                        tr.WmsgCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "安全生产")
                    {
                        tr.AqscCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "工程质量")
                    {
                        tr.GczlCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "设备管理")
                    {
                        tr.SbglCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "材料管理")
                    {
                        tr.ClglCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "综合治理")
                    {
                        tr.ZhzlCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "贯标工作")
                    {
                        tr.GbgzCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "宣传工作")
                    {
                        tr.XcgzCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "党支部工作")
                    {
                        tr.DzbgzCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                    if (tw.GetModel(Convert.ToInt32(item.g_workId)).w_workName == "信息工作")
                    {
                        tr.XxgzCent = Convert.ToSingle(item.g_cent.ToString());
                    }
                }
            }

            tr.AllCent = tr.AqscCent +
                         tr.CbkzCent +
                         tr.ClglCent +
                         tr.DzbgzCent +
                         tr.GbgzCent +
                         tr.GczlCent +
                         tr.SbglCent +
                         tr.ScjhCent +
                         tr.WmsgCent +
                         tr.XcgzCent +
                         tr.XnzhCent +
                         tr.XxgzCent +
                         tr.ZhzlCent;
            trList.Add(tr);
        }
        GridView1.DataSource = trList;
        GridView1.DataBind();
    }
Пример #26
0
        /// <summary>
        /// 查看是否有权限
        /// </summary>
        /// <param name="userID">用户ID</param>
        /// <param name="XreqestStr">小类</param>
        /// <param name="BreqestStr">大类</param>
        /// <returns>true有权限</returns>
        public static bool IfHasPrimision(string userID, string XreqestStr, string BreqestStr, bool IfRead)
        {
            string tmpUid = string.Empty;
            string tmpBid = string.Empty;
            string tmpDid = string.Empty;
            string tmpJid = string.Empty;

            Tunnel.BLL.Tunnel_menber          tm     = new Tunnel_menber();
            Tunnel.Model.Tunnel_menber        tmm    = new Tunnel.Model.Tunnel_menber();
            List <Tunnel.Model.Tunnel_menber> tmlist = new List <Tunnel.Model.Tunnel_menber>();

            Tunnel.BLL.Tunnel_jiaose   tj  = new Tunnel_jiaose();
            Tunnel.Model.Tunnel_jiaose tjj = new Tunnel.Model.Tunnel_jiaose();


            Tunnel.BLL.Tunnel_quanxian          qx     = new Tunnel_quanxian();
            Tunnel.Model.Tunnel_quanxian        qxx    = new Tunnel.Model.Tunnel_quanxian();
            List <Tunnel.Model.Tunnel_quanxian> qxlist = new List <Tunnel.Model.Tunnel_quanxian>();

            Tunnel.BLL.Tunnel_yingshe          tyj     = new Tunnel_yingshe();
            Tunnel.Model.Tunnel_yingshe        tyjj    = new Tunnel.Model.Tunnel_yingshe();
            List <Tunnel.Model.Tunnel_yingshe> tyjlist = new List <Tunnel.Model.Tunnel_yingshe>();

            Tunnel.BLL.Tunnel_uyingshe          tyu     = new Tunnel_uyingshe();
            Tunnel.Model.Tunnel_uyingshe        tyuu    = new Tunnel.Model.Tunnel_uyingshe();
            List <Tunnel.Model.Tunnel_uyingshe> tyulist = new List <Tunnel.Model.Tunnel_uyingshe>();

            Tunnel.BLL.Tunnel_byingshe          tyb     = new Tunnel_byingshe();
            Tunnel.Model.Tunnel_byingshe        tybb    = new Tunnel.Model.Tunnel_byingshe();
            List <Tunnel.Model.Tunnel_byingshe> tyblist = new List <Tunnel.Model.Tunnel_byingshe>();

            Tunnel.BLL.Tunnel_dyingshe          tyd     = new Tunnel_dyingshe();
            Tunnel.Model.Tunnel_dyingshe        tydd    = new Tunnel.Model.Tunnel_dyingshe();
            List <Tunnel.Model.Tunnel_dyingshe> tydlist = new List <Tunnel.Model.Tunnel_dyingshe>();

            UserLogin ul    = new UserLogin();
            bool      b     = false;
            string    qxStr = string.Empty;

            tmm    = tm.GetModel(Convert.ToInt64(userID));
            tmpBid = tmm.m_bum.ToString();
            tmpJid = tmm.m_jiao.ToString();
            tmpDid = tmm.m_duty.ToString();
            tmpUid = userID;

            tyulist = tyu.GetModelList("uy_uid='" + tmpUid + "'");

            if (tyulist.Count > 0)
            {
                if (tyulist[0].uy_list.Length > 0)
                {
                    qxStr += tyulist[0].uy_list + "|";
                }
            }

            tyjlist = tyj.GetModelList("y_jsid=" + tmpJid + "");

            if (tyjlist.Count > 0)
            {
                if (tyjlist[0].y_qxlist.Length > 0)
                {
                    qxStr += tyjlist[0].y_qxlist + "|";
                }
            }

            tyblist = tyb.GetModelList("by_bid='" + tmpBid + "'");

            if (tyblist.Count > 0)
            {
                if (tyblist[0].by_list.Length > 0)
                {
                    qxStr += tyblist[0].by_list + "|";
                }
            }


            tydlist = tyd.GetModelList("dy_did='" + tmpDid + "'");
            if (tydlist.Count > 0)
            {
                if (tydlist[0].dy_list.Length > 0)
                {
                    qxStr += tydlist[0].dy_list + "|";
                }
            }


            if (qxStr.Length > 0)
            {
                qxStr = qxStr.Substring(0, qxStr.Length - 1);
            }
            if (userID != "1" && ul.JiaoSe(int.Parse(userID)) != "系统管理员")
            {
                if (IfRead)
                {
                    if (tmpJid != "0")
                    {
                        if (ul.JiaoSe(int.Parse(userID)) == "总经理")
                        {
                            b = true;
                        }
                    }
                }
                if (!string.IsNullOrEmpty(qxStr))
                {
                    qxlist = qx.GetModelList("q_name='" + XreqestStr + "' and q_mark='" + BreqestStr + "'");
                    if (qxlist.Count > 0)
                    {
                        foreach (string item in qxStr.Split('|'))
                        {
                            if (qxlist[0].q_id.ToString().Equals(item.ToString()))
                            {
                                b = true;
                            }
                        }
                    }
                }
            }
            else
            {
                b = true;
            }
            return(b);
        }
Пример #27
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                id = Convert.ToInt32(Request.QueryString["id"].ToString());
                Tunnel.BLL.Tunnel_Vote   t  = new Tunnel.BLL.Tunnel_Vote();
                Tunnel.Model.Tunnel_Vote tt = new Tunnel.Model.Tunnel_Vote();
                Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
                tt = t.GetModel(id);

                voteTitle    = tt.vote_Title;
                voteUserName = tm.GetModel(Convert.ToInt32(tt.vote_userId)).m_name;
                voteDate     = Convert.ToDateTime(tt.vote_startDate).ToShortDateString();
                if (!string.IsNullOrEmpty(tt.vote_mark))
                {
                    voteMark = "<img src=../image/info.png width=20px />" + tt.vote_mark;
                }
                voteMax   = tt.vote_max.ToString();
                voteType  = tt.vote_Type.ToString();
                max.Value = voteMax;

                tvList = tv.GetModelList("ivote_voteId=" + id + "");
                Repeater1.DataSource = tvList;
                Repeater1.DataBind();
                if (voteType == "0")
                {
                    for (int i = 0; i < Repeater1.Items.Count; i++)
                    {
                        ((CheckBox)Repeater1.Items[i].FindControl("CheckBox1")).Visible = false;
                    }
                }
                else
                {
                    for (int i = 0; i < Repeater1.Items.Count; i++)
                    {
                        ((RadioButton)Repeater1.Items[i].FindControl("RadioButton1")).Visible = false;
                    }
                }
                Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
                bool b = false;
                for (int i = 0; i < tvList.Count; i++)
                {
                    string[] temp = tvList[i].ivote_yesUserId.Split(',');
                    for (int j = 0; j < temp.Length; j++)
                    {
                        if (ul.LoginID.ToString() == temp[j])
                        {
                            b = true;
                        }
                    }
                }
                if (b)
                {
                    Button1.Text = "查看结果";
                }
            }
            else
            {
                Tunnel.BLL.Tunnel_Vote          tv     = new Tunnel.BLL.Tunnel_Vote();
                List <Tunnel.Model.Tunnel_Vote> tvList = new List <Tunnel.Model.Tunnel_Vote>();
                tvList = tv.GetModelList("(getdate()>vote_startDate and getdate()<vote_endDate) and vote_state=0 and vote_top =1 order by vote_startDate desc");
                if (tvList.Count > 0)
                {
                    Response.Redirect("indexvote.aspx?id=" + tvList[0].vote_Id + "");
                }
            }
        }
    }
Пример #28
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Tunnel.BLL.Tunnel_Vote   tv  = new Tunnel.BLL.Tunnel_Vote();
        Tunnel.Model.Tunnel_Vote tvv = new Tunnel.Model.Tunnel_Vote();
        Tunnel.BLL.UserLogin     ul  = new Tunnel.BLL.UserLogin();
        tvv.vote_userId    = Convert.ToInt32(ul.LoginID.ToString());
        tvv.vote_bumGroup  = TextbumId.Value;
        tvv.vote_startDate = TextBox1.Text.Trim().Length > 0 ? Convert.ToDateTime(TextBox1.Text) : DateTime.Now;
        tvv.vote_endDate   = TextBox2.Text.Trim().Length > 0 ? Convert.ToDateTime(TextBox2.Text) : Convert.ToDateTime(tvv.vote_startDate).AddYears(1);
        tvv.vote_mark      = txtText.Text;
        tvv.vote_state     = 0;
        tvv.vote_Title     = txtTitle.Text;
        tvv.vote_top       = 0;
        tvv.vote_Type      = Convert.ToInt32(DropDownList1.SelectedValue);
        tvv.vote_max       = 1;
        if (tvv.vote_Type == 1)
        {
            if (TextBox3.Text.Length > 0)
            {
                tvv.vote_max = Convert.ToInt32(TextBox3.Text.Trim());
            }
            else
            {
                tvv.vote_max = 1;
            }
        }
        int relf = tv.Add(tvv);

        if (relf > 0)
        {
            if (CheckBox1.Checked)
            {
                #region 发消息给大家//////////////////////////////////////
                //获得所需参数
                string strToIds = tvv.vote_bumGroup;
                string strTitle = "投票:" + tvv.vote_Title;
                //写入数据库
                if (strToIds != "" && strToIds != "|")
                {
                    strToIds = strToIds.Split('|')[0].ToString();
                    if (strToIds.LastIndexOf(',') > 0)
                    {
                        strToIds = strToIds.Remove(strToIds.LastIndexOf(','), 1);
                    }
                    string[] arr = strToIds.Split(',');
                    List <Tunnel.Model.Tunnel_menber> tmList = new List <Tunnel.Model.Tunnel_menber>();
                    foreach (string item in arr)
                    {
                        Tunnel.BLL.Tunnel_menber tm = new Tunnel.BLL.Tunnel_menber();
                        tmList = new List <Tunnel.Model.Tunnel_menber>();
                        tmList = tm.GetModelList("m_bum=" + item + "");
                        for (int j = 0; j < tmList.Count; j++)
                        {
                            call(strTitle, relf.ToString(), DateTime.Now, tmList[j].m_id);
                        }
                    }
                }
                else
                {
                    List <Tunnel.Model.Tunnel_menber> tmList = new List <Tunnel.Model.Tunnel_menber>();
                    Tunnel.BLL.Tunnel_menber          tm     = new Tunnel.BLL.Tunnel_menber();
                    tmList = tm.GetModelList("");

                    foreach (Tunnel.Model.Tunnel_menber item in tmList)
                    {
                        call(strTitle, relf.ToString(), DateTime.Now, item.m_id);
                    }
                }
                #endregion
            }
            Tunnel.Common.Message.Show("添加成功!", "VoteItemsAdd.aspx?id=" + relf + "");
        }
        else
        {
            Tunnel.Common.Message.Show("添加失败!");
        }
    }
Пример #29
0
    public void showHtml(int d)
    {
        Tunnel.BLL.Tunnel_MingXing          tmx      = new Tunnel.BLL.Tunnel_MingXing();
        Tunnel.Model.Tunnel_MingXing        tmxx     = new Tunnel.Model.Tunnel_MingXing();
        List <Tunnel.Model.Tunnel_MingXing> tmxxList = new List <Tunnel.Model.Tunnel_MingXing>();

        if (d == -1)
        {
            tmxxList = tmx.GetModelList(" 1=1 order by Convert(datetime,str(m_year)+'-'+str(M_moon)+'-'+'01') desc");
            if (tmxxList.Count > 0)
            {
                d = tmxxList[0].m_id;
            }
        }

        tmxxList = tmx.GetModelList("m_id = " + d + "");

        for (int i = 0; i < tmxxList.Count; i++)
        {
            Tunnel.BLL.Tunnel_menber   tm  = new Tunnel.BLL.Tunnel_menber();
            Tunnel.Model.Tunnel_menber tmm = new Tunnel.Model.Tunnel_menber();
            tmm = tm.GetModel(Convert.ToInt64(tmxxList[i].m_uid));
            if (tmm != null)
            {
                name = tmm.m_name;
                Tunnel.BLL.Tunnel_bum   tb  = new Tunnel.BLL.Tunnel_bum();
                Tunnel.Model.Tunnel_bum tbb = new Tunnel.Model.Tunnel_bum();
                tbb = tb.GetModel(Convert.ToInt64(tmm.m_bum));
                if (tbb != null)
                {
                    bum = tbb.b_name;
                }
            }
            title   = tmxxList[i].Title.ToString();
            year    = tmxxList[i].m_year.ToString();
            moon    = tmxxList[i].m_moon.ToString();
            img     = "../N_MyWork/N_Star/" + tmxxList[i].m_img;
            content = tmxxList[i].m_content;
        }

        lblcontent.Text = content;


        string dateStr = string.Empty;

        string  tempYear = year;
        string  tempMoon = moon;
        string  tempSql  = @"
select * from (select top 4 * from (select top 4 * from tunnel_mingxing where  
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
<substring(Convert(varchar,'" + year + "-" + (moon.Length == 1 ? "0" + moon : moon) + "-01" + @"',20),0,8)+'-01'  
order by Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
desc) as bb order by 
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01')) 
 as tunnel_mingxing 
union all  
select * from (select top 1 * from tunnel_mingxing where  
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
=substring(Convert(varchar,'" + year + "-" + (moon.Length == 1 ? "0" + moon : moon) + "-01" + @"',20),0,8)+'-01' ) as tunnel_mingxing 
union all 
select * from (select top 4 * from tunnel_mingxing where  
Convert(datetime,lTRIM(str(m_year))+'-'+ltrim(str(m_moon))+'-'+'01') 
>substring(Convert(varchar,'" + year + "-" + (moon.Length == 1 ? "0" + moon : moon) + "-01" + @"',20),0,8)+'-01' ) as tunnel_mingxing 
 ";
        DataSet ds       = Tunnel.Data.DbHelperSQL.Query(tempSql);

        tmxxList = tmx.DataTableToList(ds.Tables[0]);

        foreach (Tunnel.Model.Tunnel_MingXing item in tmxxList)
        {
            if (item.m_year == Convert.ToInt32(year) && Convert.ToInt32(item.m_moon) == Convert.ToInt32(moon))
            {
                dateStr += "<a href=?id=" + item.m_id + "><font color=\"red\" style=\"14px\" >" + item.m_year + "-" + item.m_moon + "</font></a>  ";
            }
            else
            {
                dateStr += "<a href=?id=" + item.m_id + "><font color=\"black\" style=\"12px\" >" + item.m_year + "-" + item.m_moon + "</font></a>  ";
            }
        }

        //Label1.Text = dateStr;
    }
Пример #30
0
 public string showusername(object id)
 {
     Tunnel.BLL.Tunnel_menber mbll = new Tunnel.BLL.Tunnel_menber();
     return(mbll.GetModel(Convert.ToInt64(id)).m_name);
 }