// For Room Type public DataSet AddRoomType(RoomTypeBo roomTypeBo) { var transactionStatus = new TransactionStatus(); var roomType = BuiltRoomTypeDomain(roomTypeBo); CemexDb con = new CemexDb(); SqlParameter[] Params = { new SqlParameter("@Room_Name", roomType.Room_Name), //0 new SqlParameter("@Room_Descr", roomType.Room_Descr), //1 new SqlParameter("@Room_Active_flag", "True"), //2 // new SqlParameter("@opReturnValue", SqlDbType.Int)//3 }; // Params[3].Direction = ParameterDirection.Output; DataSet ds = SqlHelper.ExecuteDataset(con.GetConnection(), CommandType.StoredProcedure, "proc_AddRoomType", Params); ds.Locale = CultureInfo.InvariantCulture; //string test = Params[3].Value.ToString(); return(ds); }
public TransactionStatus EditRoomType(RoomTypeBo roomTypeBo) { var transactionStatus = new TransactionStatus(); var roomtype = BuiltRoomTypeDomain(roomTypeBo); CemexDb con = new CemexDb(); SqlConnection conn = con.GetConnection(); conn.Open(); SqlCommand cmd = new SqlCommand("dbo.proc_UpdateRoomTypes", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Room_TypeId", Convert.ToInt32(roomtype.Room_TypeId)); cmd.Parameters.AddWithValue("@Room_Name", roomtype.Room_Name); cmd.Parameters.AddWithValue("@Room_Descr", roomtype.Room_Descr); cmd.Parameters.AddWithValue("@Room_Active_flag", "true"); cmd.Parameters.AddWithValue("@opReturnValue", SqlDbType.Int); cmd.ExecuteNonQuery(); return(transactionStatus); }
private RoomType BuiltRoomTypeDomain(RoomTypeBo roomTypeBo) { return((RoomType) new RoomType().InjectFrom(roomTypeBo)); }