Exemplo n.º 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMO_SALEORDERITEM GetModel(string C_ID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select C_ID,C_BILLID,C_INITIALIZE_ID,C_ORDERNO,C_CONNO,C_INVBASDOCID,C_INVENTORYID,C_UNITID,C_FUNITID,N_NUMBER,D_CONSIGNDATE,D_DELIVERDATE,C_PK_CORP,C_ADVISECALBODYID,C_CURRENCYTYPEID,N_TAXRATE,N_ORIGINALCURPRICE,N_ORIGINALCURTAXPRICE,N_ORIGINALCURTAXMNY,N_ORIGINALCURMNY,C_RECEIPTAREAID,C_RECEIVEADDRESS,C_RECEIPTCORPID,N_ORIGINALCURSUMMNY,C_VFREE1,C_VFREE2,C_VFREE3,C_VDEF1,C_REMARK,N_STATUS,C_INITORDERID from TMO_SALEORDERITEM ");
            strSql.Append(" where C_ID=:C_ID ");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID", OracleDbType.Varchar2, 100)
            };
            parameters[0].Value = C_ID;

            Mod_TMO_SALEORDERITEM model = new Mod_TMO_SALEORDERITEM();
            DataSet ds = DbHelperOra.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                return(DataRowToModel(ds.Tables[0].Rows[0]));
            }
            else
            {
                return(null);
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(Mod_TMO_SALEORDERITEM model)
 {
     return(dal.Update(model));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public bool Add(Mod_TMO_SALEORDERITEM model)
 {
     return(dal.Add(model));
 }
Exemplo n.º 4
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Add(Mod_TMO_SALEORDERITEM model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("insert into TMO_SALEORDERITEM(");
            strSql.Append("C_ID,C_BILLID,C_INITIALIZE_ID,C_ORDERNO,C_CONNO,C_INVBASDOCID,C_INVENTORYID,C_UNITID,C_FUNITID,N_NUMBER,D_CONSIGNDATE,D_DELIVERDATE,C_PK_CORP,C_ADVISECALBODYID,C_CURRENCYTYPEID,N_TAXRATE,N_ORIGINALCURPRICE,N_ORIGINALCURTAXPRICE,N_ORIGINALCURTAXMNY,N_ORIGINALCURMNY,C_RECEIPTAREAID,C_RECEIVEADDRESS,C_RECEIPTCORPID,N_ORIGINALCURSUMMNY,C_VFREE1,C_VFREE2,C_VFREE3,C_VDEF1,C_REMARK,N_STATUS,C_INITORDERID)");
            strSql.Append(" values (");
            strSql.Append(":C_ID,:C_BILLID,:C_INITIALIZE_ID,:C_ORDERNO,:C_CONNO,:C_INVBASDOCID,:C_INVENTORYID,:C_UNITID,:C_FUNITID,:N_NUMBER,:D_CONSIGNDATE,:D_DELIVERDATE,:C_PK_CORP,:C_ADVISECALBODYID,:C_CURRENCYTYPEID,:N_TAXRATE,:N_ORIGINALCURPRICE,:N_ORIGINALCURTAXPRICE,:N_ORIGINALCURTAXMNY,:N_ORIGINALCURMNY,:C_RECEIPTAREAID,:C_RECEIVEADDRESS,:C_RECEIPTCORPID,:N_ORIGINALCURSUMMNY,:C_VFREE1,:C_VFREE2,:C_VFREE3,:C_VDEF1,:C_REMARK,:N_STATUS,:C_INITORDERID)");
            OracleParameter[] parameters =
            {
                new OracleParameter(":C_ID",                  OracleDbType.Varchar2, 100),
                new OracleParameter(":C_BILLID",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_INITIALIZE_ID",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ORDERNO",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CONNO",               OracleDbType.Varchar2, 100),
                new OracleParameter(":C_INVBASDOCID",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_INVENTORYID",         OracleDbType.Varchar2, 100),
                new OracleParameter(":C_UNITID",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_FUNITID",             OracleDbType.Varchar2, 100),
                new OracleParameter(":N_NUMBER",              OracleDbType.Decimal,   15),
                new OracleParameter(":D_CONSIGNDATE",         OracleDbType.Date),
                new OracleParameter(":D_DELIVERDATE",         OracleDbType.Date),
                new OracleParameter(":C_PK_CORP",             OracleDbType.Varchar2, 100),
                new OracleParameter(":C_ADVISECALBODYID",     OracleDbType.Varchar2, 100),
                new OracleParameter(":C_CURRENCYTYPEID",      OracleDbType.Varchar2, 100),
                new OracleParameter(":N_TAXRATE",             OracleDbType.Decimal,   15),
                new OracleParameter(":N_ORIGINALCURPRICE",    OracleDbType.Decimal,   15),
                new OracleParameter(":N_ORIGINALCURTAXPRICE", OracleDbType.Decimal,   15),
                new OracleParameter(":N_ORIGINALCURTAXMNY",   OracleDbType.Decimal,   15),
                new OracleParameter(":N_ORIGINALCURMNY",      OracleDbType.Decimal,   15),
                new OracleParameter(":C_RECEIPTAREAID",       OracleDbType.Varchar2, 100),
                new OracleParameter(":C_RECEIVEADDRESS",      OracleDbType.Varchar2, 100),
                new OracleParameter(":C_RECEIPTCORPID",       OracleDbType.Varchar2, 100),
                new OracleParameter(":N_ORIGINALCURSUMMNY",   OracleDbType.Decimal,   15),
                new OracleParameter(":C_VFREE1",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_VFREE2",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_VFREE3",              OracleDbType.Varchar2, 100),
                new OracleParameter(":C_VDEF1",               OracleDbType.Varchar2, 100),
                new OracleParameter(":C_REMARK",              OracleDbType.Varchar2, 500),
                new OracleParameter(":N_STATUS",              OracleDbType.Decimal,    1),
                new OracleParameter(":C_INITORDERID",         OracleDbType.Varchar2, 100)
            };
            parameters[0].Value  = model.C_ID;
            parameters[1].Value  = model.C_BILLID;
            parameters[2].Value  = model.C_INITIALIZE_ID;
            parameters[3].Value  = model.C_ORDERNO;
            parameters[4].Value  = model.C_CONNO;
            parameters[5].Value  = model.C_INVBASDOCID;
            parameters[6].Value  = model.C_INVENTORYID;
            parameters[7].Value  = model.C_UNITID;
            parameters[8].Value  = model.C_FUNITID;
            parameters[9].Value  = model.N_NUMBER;
            parameters[10].Value = model.D_CONSIGNDATE;
            parameters[11].Value = model.D_DELIVERDATE;
            parameters[12].Value = model.C_PK_CORP;
            parameters[13].Value = model.C_ADVISECALBODYID;
            parameters[14].Value = model.C_CURRENCYTYPEID;
            parameters[15].Value = model.N_TAXRATE;
            parameters[16].Value = model.N_ORIGINALCURPRICE;
            parameters[17].Value = model.N_ORIGINALCURTAXPRICE;
            parameters[18].Value = model.N_ORIGINALCURTAXMNY;
            parameters[19].Value = model.N_ORIGINALCURMNY;
            parameters[20].Value = model.C_RECEIPTAREAID;
            parameters[21].Value = model.C_RECEIVEADDRESS;
            parameters[22].Value = model.C_RECEIPTCORPID;
            parameters[23].Value = model.N_ORIGINALCURSUMMNY;
            parameters[24].Value = model.C_VFREE1;
            parameters[25].Value = model.C_VFREE2;
            parameters[26].Value = model.C_VFREE3;
            parameters[27].Value = model.C_VDEF1;
            parameters[28].Value = model.C_REMARK;
            parameters[29].Value = model.N_STATUS;
            parameters[30].Value = model.C_INITORDERID;

            int rows = DbHelperOra.ExecuteSql(strSql.ToString(), parameters);

            if (rows > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Mod_TMO_SALEORDERITEM DataRowToModel(DataRow row)
        {
            Mod_TMO_SALEORDERITEM model = new Mod_TMO_SALEORDERITEM();

            if (row != null)
            {
                if (row["C_ID"] != null)
                {
                    model.C_ID = row["C_ID"].ToString();
                }
                if (row["C_BILLID"] != null)
                {
                    model.C_BILLID = row["C_BILLID"].ToString();
                }
                if (row["C_INITIALIZE_ID"] != null)
                {
                    model.C_INITIALIZE_ID = row["C_INITIALIZE_ID"].ToString();
                }
                if (row["C_ORDERNO"] != null)
                {
                    model.C_ORDERNO = row["C_ORDERNO"].ToString();
                }
                if (row["C_CONNO"] != null)
                {
                    model.C_CONNO = row["C_CONNO"].ToString();
                }
                if (row["C_INVBASDOCID"] != null)
                {
                    model.C_INVBASDOCID = row["C_INVBASDOCID"].ToString();
                }
                if (row["C_INVENTORYID"] != null)
                {
                    model.C_INVENTORYID = row["C_INVENTORYID"].ToString();
                }
                if (row["C_UNITID"] != null)
                {
                    model.C_UNITID = row["C_UNITID"].ToString();
                }
                if (row["C_FUNITID"] != null)
                {
                    model.C_FUNITID = row["C_FUNITID"].ToString();
                }
                if (row["N_NUMBER"] != null && row["N_NUMBER"].ToString() != "")
                {
                    model.N_NUMBER = decimal.Parse(row["N_NUMBER"].ToString());
                }
                if (row["D_CONSIGNDATE"] != null && row["D_CONSIGNDATE"].ToString() != "")
                {
                    model.D_CONSIGNDATE = DateTime.Parse(row["D_CONSIGNDATE"].ToString());
                }
                if (row["D_DELIVERDATE"] != null && row["D_DELIVERDATE"].ToString() != "")
                {
                    model.D_DELIVERDATE = DateTime.Parse(row["D_DELIVERDATE"].ToString());
                }
                if (row["C_PK_CORP"] != null)
                {
                    model.C_PK_CORP = row["C_PK_CORP"].ToString();
                }
                if (row["C_ADVISECALBODYID"] != null)
                {
                    model.C_ADVISECALBODYID = row["C_ADVISECALBODYID"].ToString();
                }
                if (row["C_CURRENCYTYPEID"] != null)
                {
                    model.C_CURRENCYTYPEID = row["C_CURRENCYTYPEID"].ToString();
                }
                if (row["N_TAXRATE"] != null && row["N_TAXRATE"].ToString() != "")
                {
                    model.N_TAXRATE = decimal.Parse(row["N_TAXRATE"].ToString());
                }
                if (row["N_ORIGINALCURPRICE"] != null && row["N_ORIGINALCURPRICE"].ToString() != "")
                {
                    model.N_ORIGINALCURPRICE = decimal.Parse(row["N_ORIGINALCURPRICE"].ToString());
                }
                if (row["N_ORIGINALCURTAXPRICE"] != null && row["N_ORIGINALCURTAXPRICE"].ToString() != "")
                {
                    model.N_ORIGINALCURTAXPRICE = decimal.Parse(row["N_ORIGINALCURTAXPRICE"].ToString());
                }
                if (row["N_ORIGINALCURTAXMNY"] != null && row["N_ORIGINALCURTAXMNY"].ToString() != "")
                {
                    model.N_ORIGINALCURTAXMNY = decimal.Parse(row["N_ORIGINALCURTAXMNY"].ToString());
                }
                if (row["N_ORIGINALCURMNY"] != null && row["N_ORIGINALCURMNY"].ToString() != "")
                {
                    model.N_ORIGINALCURMNY = decimal.Parse(row["N_ORIGINALCURMNY"].ToString());
                }
                if (row["C_RECEIPTAREAID"] != null)
                {
                    model.C_RECEIPTAREAID = row["C_RECEIPTAREAID"].ToString();
                }
                if (row["C_RECEIVEADDRESS"] != null)
                {
                    model.C_RECEIVEADDRESS = row["C_RECEIVEADDRESS"].ToString();
                }
                if (row["C_RECEIPTCORPID"] != null)
                {
                    model.C_RECEIPTCORPID = row["C_RECEIPTCORPID"].ToString();
                }
                if (row["N_ORIGINALCURSUMMNY"] != null && row["N_ORIGINALCURSUMMNY"].ToString() != "")
                {
                    model.N_ORIGINALCURSUMMNY = decimal.Parse(row["N_ORIGINALCURSUMMNY"].ToString());
                }
                if (row["C_VFREE1"] != null)
                {
                    model.C_VFREE1 = row["C_VFREE1"].ToString();
                }
                if (row["C_VFREE2"] != null)
                {
                    model.C_VFREE2 = row["C_VFREE2"].ToString();
                }
                if (row["C_VFREE3"] != null)
                {
                    model.C_VFREE3 = row["C_VFREE3"].ToString();
                }
                if (row["C_VDEF1"] != null)
                {
                    model.C_VDEF1 = row["C_VDEF1"].ToString();
                }
                if (row["C_REMARK"] != null)
                {
                    model.C_REMARK = row["C_REMARK"].ToString();
                }
                if (row["N_STATUS"] != null && row["N_STATUS"].ToString() != "")
                {
                    model.N_STATUS = decimal.Parse(row["N_STATUS"].ToString());
                }
                if (row["C_INITORDERID"] != null)
                {
                    model.C_INITORDERID = row["C_INITORDERID"].ToString();
                }
            }
            return(model);
        }