public void GetAndBind() { List <Tunnel.Model.CheckList> clList = new List <Tunnel.Model.CheckList>(); if (workAndKID.Length > 0) { foreach (string item in workAndKID.Split('|')) { string workid = item.Split(',')[0].ToString(); //工作表ID string maxcent = item.Split(',')[1].ToString(); //最大分 string checkid = item.Split(',')[2].ToString(); //考核表ID tcc = tc.GetModel(Convert.ToInt32(checkid)); tww = tw.GetModel(Convert.ToInt32(workid)); if (tg.GetModelList("g_checkId=" + checkid + " and g_workId=" + workid + "").Count > 0) { tgg = tg.GetModelList("g_checkId=" + checkid + " and g_workId=" + workid + "")[0]; } Tunnel.Model.CheckList cl = new Tunnel.Model.CheckList(); cl.Income = tcc.c_income; cl.Score = Convert.ToInt32(tcc.c_score.ToString()); cl.Checkdate = tcc.c_date; cl.ItemsName = ti.GetModel(Convert.ToInt32(tcc.c_itemsId.ToString())).i_name; cl.UserName = tm.GetModel(Convert.ToInt64(tcc.c_userId.ToString())).m_name; cl.MaxCent = Convert.ToInt32(maxcent); cl.WorkName = tww.w_workName; cl.BumName = tww.w_bumName; cl.PFlist = "wid=" + workid + "&maxcent=" + maxcent + "&cid=" + checkid + ""; clList.Add(cl); } } GridView1.DataSource = clList; GridView1.DataBind(); }
/// <summary> /// 获得数据列表 /// </summary> public List <Tunnel.Model.Tunnel_grade> DataTableToList(DataTable dt) { List <Tunnel.Model.Tunnel_grade> modelList = new List <Tunnel.Model.Tunnel_grade>(); int rowsCount = dt.Rows.Count; if (rowsCount > 0) { Tunnel.Model.Tunnel_grade model; for (int n = 0; n < rowsCount; n++) { model = new Tunnel.Model.Tunnel_grade(); if (dt.Rows[n]["g_id"].ToString() != "") { model.g_id = int.Parse(dt.Rows[n]["g_id"].ToString()); } if (dt.Rows[n]["g_workId"].ToString() != "") { model.g_workId = int.Parse(dt.Rows[n]["g_workId"].ToString()); } if (dt.Rows[n]["g_checkId"].ToString() != "") { model.g_checkId = int.Parse(dt.Rows[n]["g_checkId"].ToString()); } if (dt.Rows[n]["g_cent"].ToString() != "") { model.g_cent = Convert.ToSingle(dt.Rows[n]["g_cent"].ToString()); } modelList.Add(model); } } return(modelList); }
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(); }
/// <summary> /// 更新一条数据 /// </summary> public void Update(Tunnel.Model.Tunnel_grade model) { dal.Update(model); }
/// <summary> /// 增加一条数据 /// </summary> public int Add(Tunnel.Model.Tunnel_grade model) { return(dal.Add(model)); }