Пример #1
0
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     Tunnel.BLL.UserLogin ul = new Tunnel.BLL.UserLogin();
     Tunnel.Model.Tunnel_ProjectReport TpRModel = new Tunnel.Model.Tunnel_ProjectReport();
     TpRModel.Report_Order  = Convert.ToInt32(txtNum.Text.Trim());
     TpRModel.Report_Name   = txtName.Text;
     TpRModel.Report_Class  = Convert.ToInt32(ddlType.SelectedValue);
     TpRModel.Report_Sort   = Convert.ToInt32(RadioButtonList1.SelectedValue);
     TpRModel.Report_State  = Convert.ToInt32(RadioButtonList3.SelectedValue);
     TpRModel.Report_UserID = ul.LoginID;
     TpRModel.Report_Shen   = Convert.ToInt32(RadioButtonList2.SelectedValue);
     Tunnel.BLL.Tunnel_ProjectReport TpRBll = new Tunnel.BLL.Tunnel_ProjectReport();
     TpRBll.Add(TpRModel);
     Tunnel.Common.Message.Show("添加成功!");
 }
Пример #2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <Tunnel.Model.Tunnel_ProjectReport> DataTableToList(DataTable dt)
        {
            List <Tunnel.Model.Tunnel_ProjectReport> modelList = new List <Tunnel.Model.Tunnel_ProjectReport>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                Tunnel.Model.Tunnel_ProjectReport model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new Tunnel.Model.Tunnel_ProjectReport();
                    if (dt.Rows[n]["Report_Id"].ToString() != "")
                    {
                        model.Report_Id = int.Parse(dt.Rows[n]["Report_Id"].ToString());
                    }
                    model.Report_Name = dt.Rows[n]["Report_Name"].ToString();
                    if (dt.Rows[n]["Report_Class"].ToString() != "")
                    {
                        model.Report_Class = int.Parse(dt.Rows[n]["Report_Class"].ToString());
                    }
                    if (dt.Rows[n]["Report_Sort"].ToString() != "")
                    {
                        model.Report_Sort = int.Parse(dt.Rows[n]["Report_Sort"].ToString());
                    }
                    if (dt.Rows[n]["Report_State"].ToString() != "")
                    {
                        model.Report_State = int.Parse(dt.Rows[n]["Report_State"].ToString());
                    }
                    if (dt.Rows[n]["Report_Shen"].ToString() != "")
                    {
                        model.Report_Shen = int.Parse(dt.Rows[n]["Report_Shen"].ToString());
                    }
                    if (dt.Rows[n]["Report_Order"].ToString() != "")
                    {
                        model.Report_Order = int.Parse(dt.Rows[n]["Report_Order"].ToString());
                    }
                    if (dt.Rows[n]["Report_UserID"].ToString() != "")
                    {
                        model.Report_UserID = int.Parse(dt.Rows[n]["Report_UserID"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Пример #3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(Tunnel.Model.Tunnel_ProjectReport model)
 {
     dal.Update(model);
 }
Пример #4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(Tunnel.Model.Tunnel_ProjectReport model)
 {
     return(dal.Add(model));
 }