public List <ReserverOrderEntity> GetReserveOrder() { // int i = 0; ReserverOrderEntity serialentity; List <ReserverOrderEntity> serialentityList = new List <ReserverOrderEntity>(); using (SqlConnection myConnection = new SqlConnection(cs)) { using (SqlCommand cmd = new SqlCommand("spGetReserveOrder", myConnection)) { cmd.CommandType = CommandType.StoredProcedure; myConnection.Open(); bool isnull = true; using (SqlDataReader dr = cmd.ExecuteReader()) { while (dr.Read()) { isnull = false; serialentity = new ReserverOrderEntity(); serialentity.ReserveId = Convert.ToInt32(dr["ReserveId"]); serialentity.MakeId = Convert.ToInt32(dr["MakeId"]); serialentity.MakeName = dr["MakeName"].ToString(); serialentity.ModelId = Convert.ToInt32(dr["ModelId"]); serialentity.ModelName = dr["ModelName"].ToString(); serialentity.ProcessorId = Convert.ToInt32(dr["ProcessorId"]); serialentity.ProcessorType = dr["ProcessorType"].ToString(); serialentity.OrderQty = Convert.ToInt32(dr["OrderQty"]); serialentity.OrderNo = Convert.ToInt32(dr["OrderNo"]); serialentity.SCreatedDate = dr["CreatedDate"].ToString(); serialentityList.Add(serialentity); } if (isnull) { return(null); } else { return(serialentityList); } } } } }
public int AddNewReserveOrder(ReserverOrderEntity entity) { using (SqlConnection con = new SqlConnection(cs)) { con.Open(); SqlCommand cmd = new SqlCommand("spNewReserveOrder", con); cmd.CommandType = CommandType.StoredProcedure; SqlParameter orderNo = cmd.Parameters.AddWithValue("@OrderNo", entity.OrderNo); SqlParameter make = cmd.Parameters.AddWithValue("@MakeId", entity.MakeId); SqlParameter Model = cmd.Parameters.AddWithValue("@ModelId", entity.ModelId); SqlParameter Processor = cmd.Parameters.AddWithValue("@ProcessorId", entity.ProcessorId); SqlParameter orderQty = cmd.Parameters.AddWithValue("@OrderQty", entity.OrderQty); return((int)cmd.ExecuteScalar()); } }
public int UpdateReserveOrder(ReserverOrderEntity entity) { ReportDL Obj = new ReportDL(); return(Obj.UpdateReserveOrder(entity)); }
public int AddNewReserveOrder(ReserverOrderEntity entity) { ReportDL Obj = new ReportDL(); return(Obj.AddNewReserveOrder(entity)); }