Ejemplo n.º 1
0
    protected void ibtnAdd_Click(object sender, EventArgs e)
    {
        //验证代码
        try
        {
            TFXK.Model.UserOrders model = new TFXK.Model.UserOrders();
            try
            {
                model.id = int.Parse(Request.QueryString["id"].ToString());
            }
            catch { model.id = 0; }

            if (model.id > 0)
            {
                model         = bll.GetModel(model.id);
                model.stateID = ddlState.SelectedIndex;
                Modify(model);
            }
        }
        catch (Exception ex)
        {
            log.Error(ex.Message);
            Msg.Show("网络错误!原因:" + ex.Message);
        }
    }
Ejemplo n.º 2
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <TFXK.Model.UserOrders> DataTableToList(DataTable dt)
        {
            List <TFXK.Model.UserOrders> modelList = new List <TFXK.Model.UserOrders>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                TFXK.Model.UserOrders model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new TFXK.Model.UserOrders();
                    if (dt.Rows[n]["id"].ToString() != "")
                    {
                        model.id = int.Parse(dt.Rows[n]["id"].ToString());
                    }
                    model.typeID      = dt.Rows[n]["typeID"].ToString();
                    model.Jijie       = dt.Rows[n]["Jijie"].ToString();
                    model.chkOrderNum = dt.Rows[n]["chkOrderNum"].ToString();
                    if (dt.Rows[n]["orderNum"].ToString() != "")
                    {
                        model.orderNum = int.Parse(dt.Rows[n]["orderNum"].ToString());
                    }
                    model.hopePrice       = dt.Rows[n]["hopePrice"].ToString();
                    model.proCode         = dt.Rows[n]["proCode"].ToString();
                    model.otherDes        = dt.Rows[n]["otherDes"].ToString();
                    model.filePaths       = dt.Rows[n]["filePaths"].ToString();
                    model.contactUserName = dt.Rows[n]["contactUserName"].ToString();
                    if (dt.Rows[n]["userSex"].ToString() != "")
                    {
                        model.userSex = int.Parse(dt.Rows[n]["userSex"].ToString());
                    }
                    model.userTel        = dt.Rows[n]["userTel"].ToString();
                    model.userPhone      = dt.Rows[n]["userPhone"].ToString();
                    model.userEmail      = dt.Rows[n]["userEmail"].ToString();
                    model.companyName    = dt.Rows[n]["companyName"].ToString();
                    model.companyAddress = dt.Rows[n]["companyAddress"].ToString();
                    if (dt.Rows[n]["stateID"].ToString() != "")
                    {
                        model.stateID = int.Parse(dt.Rows[n]["stateID"].ToString());
                    }
                    model.des1 = dt.Rows[n]["des1"].ToString();
                    model.des2 = dt.Rows[n]["des2"].ToString();
                    model.des3 = dt.Rows[n]["des3"].ToString();
                    model.des4 = dt.Rows[n]["des4"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(TFXK.Model.UserOrders model)
 {
     dal.Update(model);
 }
Ejemplo n.º 4
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int  Add(TFXK.Model.UserOrders model)
 {
     return(dal.Add(model));
 }