Exemplo n.º 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Tunnel.Model.Tunnel_duty GetModel(long d_id)
        {
            SqlParameter[] parameters =
            {
                new SqlParameter("@d_id", SqlDbType.Int)
            };
            parameters[0].Value = d_id;

            Tunnel.Model.Tunnel_duty model = new Tunnel.Model.Tunnel_duty();
            DataSet ds = DbHelperSQL.RunProcedure("Tunnel_duty_GetModel", parameters, "ds");

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["d_id"].ToString() != "")
                {
                    model.d_id = long.Parse(ds.Tables[0].Rows[0]["d_id"].ToString());
                }
                model.d_name   = ds.Tables[0].Rows[0]["d_name"].ToString();
                model.d_depict = ds.Tables[0].Rows[0]["d_depict"].ToString();
                model.d_flag   = ds.Tables[0].Rows[0]["d_flag"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         DropBind();
         if (string.IsNullOrEmpty(Request.QueryString["updid"]))
         {
             Tunnel.Common.Message.Show("非法访问!", "tunnel_dutylist.aspx");
         }
         else
         {
             did = Request.QueryString["updid"].ToString();
             Tunnel.BLL.Tunnel_duty   td  = new Tunnel.BLL.Tunnel_duty();
             Tunnel.Model.Tunnel_duty tdd = new Tunnel.Model.Tunnel_duty();
             tdd           = td.GetModel(Convert.ToInt64(did));
             txtName.Text  = tdd.d_name;
             txtName2.Text = tdd.d_depict;
             Tunnel.BLL.Tunnel_bum tb = new Tunnel.BLL.Tunnel_bum();
             if (tb.GetModelList("b_id=" + tdd.d_flag + "").Count > 0)
             {
                 DropDownList1.Items.FindByValue(tdd.d_flag).Selected = true;
             }
         }
     }
 }
Exemplo n.º 3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["id"]))
            {
                did = Request.QueryString["id"].ToString();
                Tunnel.BLL.Tunnel_duty   td  = new Tunnel.BLL.Tunnel_duty();
                Tunnel.Model.Tunnel_duty tdd = new Tunnel.Model.Tunnel_duty();
                tdd         = td.GetModel(Convert.ToInt64(did));
                Label1.Text = tdd.d_name;
                Label2.Text = tdd.d_depict;

                Tunnel.BLL.Tunnel_bum          tb     = new Tunnel.BLL.Tunnel_bum();
                Tunnel.Model.Tunnel_bum        tbb    = new Tunnel.Model.Tunnel_bum();
                List <Tunnel.Model.Tunnel_bum> tbList = new List <Tunnel.Model.Tunnel_bum>();
                tbList = tb.GetModelList("b_id=" + tdd.d_flag + "");
                if (tbList.Count > 0)
                {
                    tbb         = tbList[0];
                    Label3.Text = tbb.b_name;
                }
            }
        }
    }
Exemplo n.º 4
0
 public void upd()
 {
     Tunnel.BLL.Tunnel_duty   td  = new Tunnel.BLL.Tunnel_duty();
     Tunnel.Model.Tunnel_duty tdd = new Tunnel.Model.Tunnel_duty();
     tdd.d_id     = Convert.ToInt64(did);
     tdd.d_name   = txtName.Text;
     tdd.d_depict = txtName2.Text;
     tdd.d_flag   = DropDownList1.SelectedValue;
     td.Update(tdd);
 }
Exemplo n.º 5
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;
     }
 }
Exemplo n.º 6
0
        /// <summary>
        ///  更新一条数据
        /// </summary>
        public void Update(Tunnel.Model.Tunnel_duty model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@d_id",     SqlDbType.Int,        8),
                new SqlParameter("@d_name",   SqlDbType.VarChar,  100),
                new SqlParameter("@d_depict", SqlDbType.VarChar, 1000),
                new SqlParameter("@d_flag",   SqlDbType.VarChar, 2000)
            };
            parameters[0].Value = model.d_id;
            parameters[1].Value = model.d_name;
            parameters[2].Value = model.d_depict;
            parameters[3].Value = model.d_flag;

            DbHelperSQL.RunProcedure("Tunnel_duty_Update", parameters, out rowsAffected);
        }
Exemplo n.º 7
0
        /// <summary>
        ///  增加一条数据
        /// </summary>
        public int Add(Tunnel.Model.Tunnel_duty model)
        {
            int rowsAffected;

            SqlParameter[] parameters =
            {
                new SqlParameter("@d_id",     SqlDbType.Int,        8),
                new SqlParameter("@d_name",   SqlDbType.VarChar,  100),
                new SqlParameter("@d_depict", SqlDbType.VarChar, 1000),
                new SqlParameter("@d_flag",   SqlDbType.VarChar, 2000)
            };
            parameters[0].Direction = ParameterDirection.Output;
            parameters[1].Value     = model.d_name;
            parameters[2].Value     = model.d_depict;
            parameters[3].Value     = model.d_flag;

            DbHelperSQL.RunProcedure("Tunnel_duty_ADD", parameters, out rowsAffected);
            return((int)parameters[0].Value);
        }
Exemplo n.º 8
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tunnel.Model.Tunnel_duty> DataTableToList(DataTable dt)
        {
            List <Tunnel.Model.Tunnel_duty> modelList = new List <Tunnel.Model.Tunnel_duty>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tunnel.Model.Tunnel_duty model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new Tunnel.Model.Tunnel_duty();
                    model.d_id     = Convert.ToInt64(dt.Rows[n]["d_id"].ToString());
                    model.d_name   = dt.Rows[n]["d_name"].ToString();
                    model.d_depict = dt.Rows[n]["d_depict"].ToString();
                    model.d_flag   = dt.Rows[n]["d_flag"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 9
0
        public List <Tunnel.Model.Tunnel_duty> GetList(PageBase pb, ref int count)
        {
            DataTable dt = dal.GetList(pb, ref count).Tables[0];
            List <Tunnel.Model.Tunnel_duty> modelList = new List <Tunnel.Model.Tunnel_duty>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0 && pb.DoCount == 0)
            {
                Tunnel.Model.Tunnel_duty model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model          = new Tunnel.Model.Tunnel_duty();
                    model.d_id     = Convert.ToInt64(dt.Rows[n]["d_id"].ToString());
                    model.d_name   = dt.Rows[n]["d_name"].ToString();
                    model.d_depict = dt.Rows[n]["d_depict"].ToString();
                    model.d_flag   = dt.Rows[n]["d_flag"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Exemplo n.º 10
0
    /// <summary>
    /// 明星员工
    /// </summary>
    /// <param name="d"></param>
    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;
                    if (!string.IsNullOrEmpty(bum))
                    {
                        if (bum.Length > 8)
                        {
                            bum = bum.Substring(0, 8);
                        }
                    }
                }

                Tunnel.BLL.Tunnel_duty   td  = new Tunnel.BLL.Tunnel_duty();
                Tunnel.Model.Tunnel_duty tdd = new Tunnel.Model.Tunnel_duty();
                tdd = td.GetModel(Convert.ToInt64(tmm.m_duty));
                if (tdd != null)
                {
                    duty = tdd.d_name;
                }
            }
            year = tmxxList[i].m_year.ToString();
            moon = tmxxList[i].m_moon.ToString();
            img  = "N_MyWork/N_Star/" + tmxxList[i].m_img;
            mxId = tmxxList[i].m_id.ToString();
        }

        string tempYear = DateTime.Now.AddMonths(-12).Year.ToString();
        string tempMoon = DateTime.Now.AddMonths(-12).Month.ToString();

        tmxxList = tmx.GetModelList("m_year >= " + tempYear + "  order by Convert(datetime,str(m_year)+'-'+str(M_moon)+'-'+'01') asc");

        int count = 0;

        foreach (Tunnel.Model.Tunnel_MingXing item in tmxxList)
        {
            if (item.m_moon >= Convert.ToInt32(tempMoon) || item.m_year != DateTime.Now.Year)
            {
                content += "<a href=?id=" + item.m_id + ">" + item.m_year + "-" + item.m_moon + "</a>  ";
                count++;
            }
            if (count > 1)
            {
                break;
            }
        }
    }
Exemplo n.º 11
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Tunnel.Model.Tunnel_duty model)
 {
     dal.Update(model);
 }
Exemplo n.º 12
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Tunnel.Model.Tunnel_duty model)
 {
     return(dal.Add(model));
 }