public static DlyNdxEntity DataRowToEntity(DataRow row) { if (row == null) return null; var result = new DlyNdxEntity() { DlyNdxId = (string)(row["DlyNdxId"]), DlyNo = (string)(row["DlyNo"]), DlyTypeId = (int)(row["DlyTypeId"]), DlyDate = (string)(row["DlyDate"]), CompanyId = (int)(row["CompanyId"]), JSRId = (string)(row["JSRId"]), StockId1 = (int)(row["StockId1"]), StockId2 = (int)(row["StockId2"]), Draft = (short)(row["Draft"]), Summary = (string)(row["Summary"]), Comment = (string)(row["Comment"]), ZDRId = (string)(row["ZDRId"]), SHRId1 = (string)(row["SHRId1"]), SHRId2 = (string)(row["SHRId2"]), SHRId3 = (string)(row["SHRId3"]), SHRId4 = (string)(row["SHRId4"]), SHRId5 = (string)(row["SHRId5"]), IsInvoce = (bool)(row["IsInvoce"]), Total = (decimal)(row["Total"]), QGNo = (string)(row["QGNo"]), QGDate = (string)(row["QGDate"]), QGR = (string)(row["QGR"]), YDJNo = (string)(row["YDJNo"]), BuyDate = (string)(row["BuyDate"]), Buyer = (string)(row["Buyer"]), LXR = (string)(row["LXR"]), LXFS = (string)(row["LXFS"]), }; return result; }
public static DlyNdxEntity[] DataTableToEntitys(DataTable dt) { if (dt == null) return null; var results = new DlyNdxEntity[dt.Rows.Count]; for (int i = 0; i < dt.Rows.Count; i++) { results[i] = DataRowToEntity(dt.Rows[i]); } return results; }
public static DbCommand GetCreatePreferBakCommand(Database database, DlyNdxEntity entity, decimal prefer) { DbCommand cmd = database.GetStoredProcCommand("P_CreatePDlyABak"); database.AddOutParameter(cmd, "PDlyABakId", DbType.String, 36); #region 参数赋值 database.AddInParameter(cmd, "DlyNdxId", DbType.String, entity.DlyNdxId); database.AddInParameter(cmd, "ATypeId", DbType.Int32, FengSharp.OneCardAccess.Application.Config.DlyConfig.SPYHATypeId); database.AddInParameter(cmd, "CompanyId", DbType.Int32, entity.CompanyId); database.AddInParameter(cmd, "JSRId", DbType.String, entity.JSRId); database.AddInParameter(cmd, "StockId", DbType.Int32, entity.StockId1); database.AddInParameter(cmd, "Total", DbType.Decimal, prefer); database.AddInParameter(cmd, "DlyDate", DbType.String, entity.DlyDate); database.AddInParameter(cmd, "DlyTypeId", DbType.Int32, entity.DlyTypeId); database.AddInParameter(cmd, "Remark", DbType.String, string.Empty); #endregion return cmd; }
public static DbCommand GetDeleteDlyNdxCommand(Database database, DlyNdxEntity entity, string cMode) { DbCommand cmd = database.GetStoredProcCommand("P_DeleteDlyNdx"); database.AddInParameter(cmd, "DlyNdxId", DbType.String, entity.DlyNdxId); database.AddInParameter(cmd, "cMode", DbType.String, cMode); return cmd; }
public static DbCommand GetCreateDlyNdxCommand(Database database, DlyNdxEntity entity) { DbCommand cmd = database.GetStoredProcCommand("P_CreateDlyNdx"); database.AddOutParameter(cmd, "DlyNdxId", DbType.String, 36); #region 参数赋值 database.AddInParameter(cmd, "DlyNo", DbType.String, entity.DlyNo); database.AddInParameter(cmd, "DlyTypeId", DbType.Int32, entity.DlyTypeId); database.AddInParameter(cmd, "DlyDate", DbType.String, entity.DlyDate); database.AddInParameter(cmd, "CompanyId", DbType.Int32, entity.CompanyId); database.AddInParameter(cmd, "JSRId", DbType.String, entity.JSRId); database.AddInParameter(cmd, "StockId1", DbType.Int32, entity.StockId1); database.AddInParameter(cmd, "StockId2", DbType.Int32, entity.StockId2); database.AddInParameter(cmd, "Draft", DbType.Int16, entity.Draft); database.AddInParameter(cmd, "Summary", DbType.String, entity.Summary); database.AddInParameter(cmd, "Comment", DbType.String, entity.Comment); database.AddInParameter(cmd, "ZDRId", DbType.String, entity.ZDRId); database.AddInParameter(cmd, "SHRId1", DbType.String, entity.SHRId1); database.AddInParameter(cmd, "SHRId2", DbType.String, entity.SHRId2); database.AddInParameter(cmd, "SHRId3", DbType.String, entity.SHRId3); database.AddInParameter(cmd, "SHRId4", DbType.String, entity.SHRId4); database.AddInParameter(cmd, "SHRId5", DbType.String, entity.SHRId5); //database.AddInParameter(cmd, "IsInvoce", DbType.Boolean, entity.IsInvoce); database.AddInParameter(cmd, "Total", DbType.Decimal, entity.Total); database.AddInParameter(cmd, "QGNo", DbType.String, entity.QGNo); database.AddInParameter(cmd, "QGDate", DbType.String, entity.QGDate); database.AddInParameter(cmd, "QGR", DbType.String, entity.QGR); database.AddInParameter(cmd, "YDJNo", DbType.String, entity.YDJNo); database.AddInParameter(cmd, "BuyDate", DbType.String, entity.BuyDate); database.AddInParameter(cmd, "Buyer", DbType.String, entity.Buyer); database.AddInParameter(cmd, "LXR", DbType.String, entity.LXR); database.AddInParameter(cmd, "LXFS", DbType.String, entity.LXFS); #endregion return cmd; }