Ejemplo n.º 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public webs_YueyxShop.Model.OrderBase GetModel(int o_ID)
        {
            StringBuilder strSql=new StringBuilder();
            strSql.Append("select  top 1 o_ID,c_ID,m_ID,o_Code,o_CreateOn,o_Pric,o_Zhek,o_StatusCode,o_Mark,o_IsDel,pay_ID,st_ID,o_AlipayNo,o_LogisticsNo,o_Score from OrderBase ");
            strSql.Append(" where o_ID='"+o_ID+"'");

            webs_YueyxShop.Model.OrderBase model=new webs_YueyxShop.Model.OrderBase();
            DataSet ds=DbHelperSQL.Query(strSql.ToString());
            if(ds.Tables[0].Rows.Count>0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public webs_YueyxShop.Model.OrderBase DataRowToModel2(DataRow row)
 {
     webs_YueyxShop.Model.OrderBase model = new webs_YueyxShop.Model.OrderBase();
     if (row != null)
     {
         if (row["o_ID"] != null && row["o_ID"].ToString() != "")
         {
             model.o_ID = int.Parse(row["o_ID"].ToString());
         }
         if (row["c_ID"] != null && row["c_ID"].ToString() != "")
         {
             model.c_ID = int.Parse(row["c_ID"].ToString());
         }
         if (row["m_ID"] != null && row["m_ID"].ToString() != "")
         {
             model.m_ID = int.Parse(row["m_ID"].ToString());
         }
         if (row["o_Code"] != null)
         {
             model.o_Code = row["o_Code"].ToString();
         }
         if (row["o_CreateOn"] != null && row["o_CreateOn"].ToString() != "")
         {
             model.o_CreateOn = DateTime.Parse(row["o_CreateOn"].ToString());
         }
         if (row["o_Pric"] != null && row["o_Pric"].ToString() != "")
         {
             model.o_Pric = decimal.Parse(row["o_Pric"].ToString());
         }
         if (row["o_Zhek"] != null && row["o_Zhek"].ToString() != "")
         {
             model.o_Zhek = decimal.Parse(row["o_Zhek"].ToString());
         }
         if (row["o_StatusCode"] != null && row["o_StatusCode"].ToString() != "")
         {
             model.o_StatusCode = int.Parse(row["o_StatusCode"].ToString());
         }
         if (row["o_Mark"] != null)
         {
             model.o_Mark = row["o_Mark"].ToString();
         }
         if (row["o_IsDel"] != null && row["o_IsDel"].ToString() != "")
         {
             if ((row["o_IsDel"].ToString() == "1") || (row["o_IsDel"].ToString().ToLower() == "true"))
             {
                 model.o_IsDel = true;
             }
             else
             {
                 model.o_IsDel = false;
             }
         }
         if (row["pay_ID"] != null && row["pay_ID"].ToString() != "")
         {
             model.pay_ID = int.Parse(row["pay_ID"].ToString());
         }
         if (row["st_ID"] != null && row["st_ID"].ToString() != "")
         {
             model.st_ID = int.Parse(row["st_ID"].ToString());
         }
         if (row["r_Status"] != null && row["r_Status"].ToString() != "" && row["r_Date"] != null && row["st_ID"].ToString() != "")
         {
             model.rejorder = new Model.RejectionBase
             {
                 r_Status = int.Parse(row["r_Status"].ToString()),
                 r_Date = DateTime.Parse(row["r_Date"].ToString()),
                 r_Price = decimal.Parse(row["r_Price"].ToString())
             };
         }
         if (row["o_AlipayNo"] != null)
         {
             model.o_AlipayNo = row["o_AlipayNo"].ToString();
         }
         if (row["o_LogisticsNo"] != null)
         {
             model.o_LogisticsNo = row["o_LogisticsNo"].ToString();
         }
         if (row["o_Score"] != null && row["o_Score"].ToString() != "")
         {
             model.o_Score = int.Parse(row["o_Score"].ToString());
         }
     }
     return model;
 }