Ejemplo n.º 1
0
    public void ListBind2()
    {
        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> ilist = new List <Tunnel.Model.Tunnel_items>();

        DropDownList1.Items.Clear();
        ilist = ti.GetModelList(" year='" + DropDownList2.SelectedValue + "' and  moon='" + DropDownList3.SelectedValue + "'");
        foreach (Tunnel.Model.Tunnel_items item in ilist)
        {
            DropDownList1.Items.Add(new ListItem(item.i_name, item.i_id.ToString()));
        }
        DropDownList1.Items.Insert(0, new ListItem("请选择", "0"));
    }
Ejemplo n.º 2
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        Tunnel.BLL.Tunnel_items   ti  = new Tunnel.BLL.Tunnel_items();
        Tunnel.Model.Tunnel_items tii = new Tunnel.Model.Tunnel_items();
        tii.i_name = txtItems.Text.Trim();
        tii.year   = TextBox1.Text;
        tii.moon   = TextBox2.Text;

        if (ti.GetModelList("1=1 and i_name = '" + tii.i_name + "' and year = '" + tii.year + "' and moon = '" + tii.moon + "'").Count == 0)
        {
            if (ti.Add(tii) > 0)
            {
                Tunnel.Common.Message.Show("添加工程项目成功!");
            }
            else
            {
                Tunnel.Common.Message.Show("添加工程项目失败!");
            }
        }
        else
        {
            Tunnel.Common.Message.Show("本月存在该项目!");
        }
    }
Ejemplo n.º 3
0
    public void ListBind()
    {
        DropDownList1.Items.Clear();
        DropDownList2.Items.Clear();
        DropDownList3.Items.Clear();
        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> ilist = new List <Tunnel.Model.Tunnel_items>();

        for (int i = 2009; i < 2019; i++)
        {
            DropDownList2.Items.Add(new ListItem(i.ToString(), i.ToString()));
        }
        for (int i = 1; i < 13; i++)
        {
            if (i.ToString().Length == 2)
            {
                DropDownList3.Items.Add(new ListItem(i.ToString(), i.ToString()));
            }
            else
            {
                DropDownList3.Items.Add(new ListItem("0" + i.ToString(), "0" + i.ToString()));
            }
        }
        DateTime dt = DateTime.Now.AddMonths(-1);

        DropDownList2.Items.FindByValue(dt.Year.ToString()).Selected = true;
        DropDownList3.Items.FindByValue(dt.Month.ToString().Length > 1 ? dt.Month.ToString() : "0" + dt.Month.ToString()).Selected = true;

        ilist = ti.GetModelList(" year='" + DropDownList2.SelectedValue + "' and  moon='" + DropDownList3.SelectedValue + "'");
        foreach (Tunnel.Model.Tunnel_items item in ilist)
        {
            DropDownList1.Items.Add(new ListItem(item.i_name, item.i_id.ToString()));
        }
        DropDownList1.Items.Insert(0, new ListItem("请选择", "0"));
    }
Ejemplo n.º 4
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();
    }